3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = 'Nečum spaces to dash and LowerCase with PHP'; $separator = '-'; $str_replace = str_replace(' ', $separator, strtolower($str)); $wordwrap = wordwrap(strtolower($str), 1, $separator, 0); $test = iconv('ISO-8859-1','ASCII//TRANSLIT',$wordwrap); echo 'Original: ' . "\t" . $str . "\n"; echo 'str_replace: ' . "\t" . $str_replace . "\n"; echo 'wordwrap: ' . "\t" . $wordwrap . "\n"; echo 'test: ' . "\t" . $test . "\n";
Output for 5.6.30, hhvm-3.15.4 - 3.22.0, 7.0.0 - 7.3.0rc3
Original: Nečum spaces to dash and LowerCase with PHP str_replace: nečum-spaces-to-dash-and-lowercase-with-php wordwrap: nečum-spaces-to-dash-and-lowercase-with-php test: ne??um-spaces-to-dash-and-lowercase-with-php