3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function clean($string) { $string = str_replace(' ', '', $string); return preg_replace('/[^A-Za-z0-9\-]', '', $string); } $string = 'Lee%-&*d#'; echo clean($string); echo $string;
based on F7qKR
Output for 4.3.11 - 7.1.10
Warning: preg_replace(): No ending delimiter '/' found in /in/1AQ6Y on line 5 Lee%-&*d#
Output for 4.3.0 - 4.3.10
Warning: No ending delimiter '/' found in /in/1AQ6Y on line 5 Lee%-&*d#