Am trying to insert space before and after every non alphanumeric character in the string, for example string like (good+bad)*nice which will be entered by user, I want to make it look like ( good + bad ) * nice. The reason i want to do this, is because i want to put them in array which is going to look like this;
$arr[0] = "(";
$arr[1] = "good”;
$arr[2] = "+”;
$arr[3] = "bad";
$arr[4] = ")";
$arr[5] = "*";
$arr[6] = "+";