3v4l.org

run code in 300+ PHP versions simultaneously
<?php $name = 'my file:name?w[ith/illegal*cha]racters\"that<are>not\allowed|here.txt'; $newName = preg_replace('/[\?\/:|<>*\[\]\(\)\$%\{\}@~\s]/', '_', $name); var_dump($newName);

preferences:
20.54 ms | 405 KiB | 5 Q