3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = ''; foreach(str_split(iconv("UTF-8", "Windows-1252", "my utf8 string áéíóú")) as $n => $c) { if (ord($c) > 127) { $c = '%'.bin2hex($c); } $string .= $c; } var_dump($string);

preferences:
76.17 ms | 402 KiB | 5 Q