3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function clean($s) { $s = ereg_replace("[áàâãª]","a",$s); $s = ereg_replace("[ÁÀÂÃ]","A",$s); $s = ereg_replace("[éèê]","e",$s); $s = ereg_replace("[ÉÈÊ]","E",$s); $s = ereg_replace("[íìî]","i",$s); $s = ereg_replace("[ÍÌÎ]","I",$s); $s = ereg_replace("[óòôõº]","o",$s); $s = ereg_replace("[ÓÒÔÕ]","O",$s); $s = ereg_replace("[úùû]","u",$s); $s = ereg_replace("[ÚÙÛ]","U",$s); $s = str_replace(" ","-",$s); $s = str_replace("ñ","n",$s); $s = str_replace("Ñ","N",$s); //para ampliar los caracteres a reemplazar agregar lineas de este tipo: //$s = str_replace("caracter-que-queremos-cambiar","caracter-por-el-cual-lo-vamos-a-cambiar",$s); return $s; } $a = "COLÃ?N 1391"; echo clean($a);
based on 6XBCu
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function ereg_replace() in /in/GRt5d:4 Stack trace: #0 /in/GRt5d(24): clean('COL\xC3\x83\xC6\x92?N 1391') #1 {main} thrown in /in/GRt5d on line 4
Process exited with code 255.
Output for 5.3.17 - 5.6.28
Deprecated: Function ereg_replace() is deprecated in /in/GRt5d on line 4 Deprecated: Function ereg_replace() is deprecated in /in/GRt5d on line 5 Deprecated: Function ereg_replace() is deprecated in /in/GRt5d on line 6 Deprecated: Function ereg_replace() is deprecated in /in/GRt5d on line 7 Deprecated: Function ereg_replace() is deprecated in /in/GRt5d on line 8 Deprecated: Function ereg_replace() is deprecated in /in/GRt5d on line 9 Deprecated: Function ereg_replace() is deprecated in /in/GRt5d on line 10 Deprecated: Function ereg_replace() is deprecated in /in/GRt5d on line 11 Deprecated: Function ereg_replace() is deprecated in /in/GRt5d on line 12 Deprecated: Function ereg_replace() is deprecated in /in/GRt5d on line 13 COLaA�O?N-1391