How to remove the special characters in title?


// take out repetative spaces:
$foldername = preg_replace(‘/\s\s+/’, ‘ ‘, $foldername);
if ($foldername == “”){$foldername = “untitled”;}
$foldername= trim(strtolower($foldername));
$array=explode(” “,$foldername);
$foldername=implode(“-“, $array);
echo ($foldername);
?>