Inorder to split the string i have used the following code.
$string = "-sev*yes-sev1*no-sev2*yes";
split('[-*]', $string).
As split is deprecated, can you please suggest an alternative to split the string into an array. I have tried with explode, but it is not serving my purpose. The output should look like,
Array
(
[0] => sev
[1] => yes
[2] => sev1
[3] => no
[4] => sev2
[5] => yes
)
Thank u all for ur responses..I tried preg_split('[-*]', $string)
. It has split has the string character wise. I have modified it to preg_split('/[-*]/', $string)
. It is working well. It would be great if you can explain me the difference.