Hi,
I am trying to remove duplicate commas in a string leaving just one with the following code. but it removes all duplicate characters, how can i do it just to remove the commas?
$str = 'aabb,,ccaaaaadd,,,ee';
echo preg_replace('{(.)\1+}','$1',$str);
Thanks
Jules