I currently have the line shown below
$string = "4WL533cba00780352524MT_FAILED(SCRNotInAllowList) STATUS_NOT_AVAILABLE";
I read the online tutorial:
(gif|jpg) Matches either "gif" or "jpeg".
In my case, I only need to split when the text contains DN_ or MT _
$data = preg_split("/[\s,(DN_|MT_),]+/", trim($string));
conclusion
[0] => Array
(
[0] => 4WL533cba00780352524
[1] => FAILE
[2] => SCR
[3] => otInAllowList
[4] => S
[5] => A
[6] => US
[7] => O
[8] => AVAILABLE
)
however, I expect the output to be:
[0] => Array
(
[0] => 4WL533cba00780352524
[1] => MT_FAILED(SCRNotInAllowList)
[2] => STATUS_NOT_AVAILABLE
)
Hope you guys can help me.
source
share