Hey, ho scritto questo articolo 14 anni e 10 mesi fa.
È molto probabile che nel frattempo le cose siano cambiate.
È molto probabile che nel frattempo le cose siano cambiate.
a better (?) version of toAscii function by Matteo Spinelli
function slug_me($str, $replace=array(), $delimiter='-', $charset='ISO-8859-1') { $str = iconv($charset, 'UTF-8', $str); if (!empty($replace)) { $str = str_replace((array)$replace, ' ', $str); } $clean = iconv('UTF-8', 'ASCII//TRANSLIT', $str); $clean = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $clean); $clean = strtolower(trim($clean, '-')); $clean = preg_replace("/[\/_|+ -]+/", $delimiter, $clean); return $clean; }