3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "234pLdfvw"; $text = preg_replace('~[^pLdw]+~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:
35.21 ms | 402 KiB | 5 Q