Here is a function that is used in the My_eGallery modules for PHP nuke.
function find_nom_dif($nom)
{
$nom=stripslashes($nom);
$nom=str_replace("'","",$nom);
$nom=str_replace("\"","",$nom);
$nom=str_replace("\"","",$nom);
$nom=str_replace("&","",$nom);
$nom=str_replace(",","",$nom);
$nom=str_replace(";","",$nom);
$nom=str_replace("/","",$nom);
$nom=str_replace("\\","",$nom);
$nom=str_replace("`","",$nom);
$nom=str_replace("<","",$nom);
$nom=str_replace(">","",$nom);
$nom=str_replace(" ","_",$nom);
$nom=str_replace(":","",$nom);
$nom=str_replace("*","",$nom);
$nom=str_replace("|","",$nom);
$nom=str_replace("?","",$nom);
$nom=str_replace("�","e",$nom);
$nom=str_replace("�","e",$nom);
$nom=str_replace("�","c",$nom);
$nom=str_replace("@","",$nom);
$nom=str_replace("�","a",$nom);
$nom=str_replace("�","e",$nom);
$nom=str_replace("�","i",$nom);
$nom=str_replace("�","o",$nom);
$nom=str_replace("�","u",$nom);
$nom=str_replace("�","u",$nom);
$nom=str_replace("�","a",$nom);
$nom=str_replace("!","",$nom);
$nom=str_replace("�","",$nom);
$nom=str_replace("+","",$nom);
$nom=str_replace("^","",$nom);
$nom=str_replace("(","",$nom);
$nom=str_replace(")","",$nom);
$nom=str_replace("#","",$nom);
$nom=str_replace("=","",$nom);
$nom=str_replace("$","",$nom);
$nom=str_replace("%","",$nom);
$nom=str_replace("�","ae",$nom);
$nom=str_replace("�","Ae",$nom);
$nom=str_replace("�","oe",$nom);
$nom=str_replace("�","Oe",$nom);
$nom=str_replace("�","ue",$nom);
$nom=str_replace("�","Ue",$nom);
$nom=str_replace("�","ss",$nom);
return $nom;
}
/Martin
Citat Javier Montserat <[EMAIL PROTECTED]>:
> i want to format the filename of an uploaded file as follows :-
>
> -- replace blankspace with "_"
>
> -- remove any illegal characters.
>
> Which string functions should I use to do this?
>
> Thanks,
>
> Javier
>
>
>
> _________________________________________________________________
> Join the world�s largest e-mail service with MSN Hotmail.
> http://www.hotmail.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
mvh
Martin Hjort Eriksen
Studenterr�det, Roskilde Universitetscenter
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php