3v4l.org

run code in 300+ PHP versions simultaneously
<?php function sanitizeFilename(string $name): string { return preg_replace( '/\W+/', '', str_replace(' ', '_', $name) ); } echo sanitizeFilename('This/is My 1! FilenAm3');

preferences:
27.63 ms | 405 KiB | 5 Q