3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string = '(`anurag`, 1,2), (1,2,3), `dm0c60544`,(2 ,3 ,3) '; $pattern = '#[`a-zA-Z]+,#'; // our regex pattern $string = preg_replace_all($pattern, '', $string); //replace backticked text and the following comma $string = str_replace(' ', '', $string); // remove unwanted whitespace echo $string;
based on WEj3l
Output for 7.0.0 - 7.3.0rc3
Fatal error: Uncaught Error: Call to undefined function preg_replace_all() in /in/eZO0R:7 Stack trace: #0 {main} thrown in /in/eZO0R on line 7
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: Call to undefined function preg_replace_all() in /in/eZO0R:7 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Fatal error: Call to undefined function preg_replace_all() in /in/eZO0R on line 7
Process exited with code 255.