<?php
function removeQuotedValues($string)
{
$pattern = '#``(.*?)`#';
$string = preg_replace($pattern, '', $string);
$replace = array(' ' => '', '(,' => '(', ',)' => ')', ',,' => ',');
foreach ($replace as $old => $new) {
$string = str_replace($old, $new, $string);
}
return $string;
}
$string = '(`g3tR1d0fM3`, 1,2), (1,2,3, `14ls0n33dr3m0v1ng`),(2 ,3 ,3) ';
echo removeQuotedValues($string);
preferences:
48.46 ms | 402 KiB | 5 Q