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

Reply via email to