3v4l.org

run code in 300+ PHP versions simultaneously
<?php function tagify($text, $spacer = '-') { //Handle if array if (is_array($text)) { return array_map("tagify", $text); } $text = str_replace('&', 'and', $text); return str_replace(' ', $spacer, trim(preg_replace('#([^a-z0-9/]+)#', ' ', strtolower($text)))); } var_dump(tagify(['something else', 'per che']));

preferences:
41.46 ms | 402 KiB | 5 Q