3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $name = strtolower($name); $name = str_replace('à', 'a', $name); $name = str_replace(array('è', 'é'), 'e', $name); $name = str_replace('ì', 'i', $name); $name = str_replace('ò', 'o', $name); $name = str_replace('ù', 'u', $name); $name = str_replace(array("'", '.', ','), ' ', $name); $name = trim($name); $name = preg_replace('/ */', '-', $name); $name = preg_replace('/[^a-z0-9-]+/', '-', $name); while(strpos($name, '--')!==false) $name = str_replace('--', '-', $name); $name = preg_replace('/^-(.+)$/', '\\1', $name); $name = preg_replace('/^(.+)-$/', '\\1', $name); $names[$n] = $name;
Output for 5.0.4 - 7.1.0
Notice: Undefined variable: name in /in/5mS0u on line 3 Notice: Undefined variable: n in /in/5mS0u on line 3
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: name in /in/5mS0u on line 3 Notice: Undefined variable: n in /in/5mS0u on line 3