<?php
// Maybe put this in a filter class?
function removeQuotedValues($string)
{
$pattern = '#`[a-zA-Z0-9]+`#'; // our regex pattern
$string = preg_replace($pattern, '', $string); //remove `backtickedStrings`
echo $string ."\n";
$string = str_replace(' ', '', $string); // remove unwanted whitespace
$string = str_replace('(,', '(', $string); // remove unwanted comma
$string = str_replace(',)', ')', $string); // remove unwanted comma
$string = str_replace(',,', ',', $string); // remove unwanted comma
return $string;
}
$string = '(`anurag`, 1,2), (1,2,3, `dm0c60544`),(2 ,3 ,3) ';
echo removeQuotedValues($string);
preferences:
45.74 ms | 402 KiB | 5 Q