Am trying to replace comma followed by multiple spaces and & symbol with & using php. Is there any way to do it
example: a, & b.
expected output: a & b.
I have tried but it works for only single space. doesn't work for multiple dynamic spaces. Here is my sample code
$var = "a, & b.";
$var = str_replace(', &','&',$var);