30apr/090
slug_me
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;
}



