I want to split alpha-numeric (with space) and non-alpha-numeric by comma in a string.
I tried with this...
$str = "This is !@#$%^&";
preg_replace("/([a-z0-9_\s])([^a-z0-9_])/i", "$1, $2", $str);
But I got this result...
This, is, !@#$%^&
How can I fix the search pattarn to get this result?
This is, !@#$%^&
Thanks.