3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function removeQuotedValues($string) { $pattern = '#`[a-zA-Z0-9]+`#'; $string = preg_replace($pattern, '', $string); $replace = array(' ' => '', '(,' => '(', ',)' => ')', ',,' => ','); foreach ($replace as $old => $new) { $string = str_replace($old, $new, $string); } return $string; } $string = '(`getridofme`, 1,2), (1,2,3, `dm0c60544`),(2 ,3 ,3) '; echo removeQuotedValues($string);
based on 2uQU4
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0rc3
(1,2),(1,2,3),(2,3,3)