3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "234pLdfv"; $text = preg_replace('~[^pLd]+~u', '-', $text); $text = iconv('utf-8', 'us-ascii//TRANSLIT', $text); $text = strtolower($text); // remove unwanted characters $text = preg_replace('~[^-w]+~', '', $text); if (empty($text)) { echo 'n-a'; } echo $text;

preferences:
36.24 ms | 402 KiB | 5 Q