I need to delete comma ,
before each closing bracket )
.
Example string:
$string = "('abc', 'def', 'gah',), ('qwe', 'rty', 'yui',)"
I have tried multiple times combining substr, str_replace. It just gives me wrong results.
Could you please help me out with this?
you need to replace ",)"
by ")"
$string = "('abc', 'def', 'gah',), ('qwe', 'rty', 'yui',)";
$string = str_replace(",)", ")", $string);