3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'this is Tom & Jerry'; echo preg_replace('/[^a-z\d]+/i', '-', $string);

preferences:
30.49 ms | 404 KiB | 5 Q