Ciao,
io generalmente utilizzo una funzione trovata nel web qualche anno fa per sostituire i caratteri non alfanumerici:
[PHP]
function getRewriteString($stringa)
{
$carattere_sostitutivo="-";
$string = strtolower(htmlentities($stringa));
$temp = preg_replace("/&(.)(uml);/", "$1e", $temp);
$temp = preg_replace("/&(.)(acute|cedil|circ|ring|tilde|uml|grave);/", "$1",$temp);
$temp = preg_replace("/([^a-z0-9]+)/", $carattere_sostitutivo,html_entity_decode($temp));
$temp = trim($temp, $carattere_sostitutivo);
return $temp;
}
[/PHP]
Attenzione però che devi isolare il nome del file dall'estensione, altrimenti viene sostituito anche il . prima dell'estensione del file.
Alessandro