Hi friends am trying to replace two commas separated by space with space using php. Here is my code
Suppose for example am having variable like
$va
preg_replace('/(,\s?)+$/', '', "hello, welcome, , , ,");
Basically, match every contiguous sequence of , until the end of the string.
,
see https://regex101.com/r/rSp90e/1 for a demo.