Sent: Thursday, September 05, 2002 9:34 AM
To: Javier Montserat
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] formatting a filename
On Thu, 5 Sep 2002, Javier Montserat wrote:
> i want to format the filename of an uploaded file as follows :-
> -- replace blankspace with "_"
> --
On Thu, 5 Sep 2002, Javier Montserat wrote:
> 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?
http://www.php.net/manual/en/function.ereg.php
http://www.php.net/m
I use this, it includes also national characters
$name=strtr( $name,
"`O}ao~¾YYµAÁÂAÄAAÇEÉEËIÍÎI?NOÓÔOÖOUÚUÜÝßaáâaäaaçeéeëiíîi?noóôoöouúuüýy
*!@#$%^&()+=",
"SOZsozlYYuAAACDNOOYsaaaconooyy_");
Javier Montserat wrote:
> i want to format the file
[snip]
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?
[/snip]
http://www.php.net/manual/en/function.eregi-replace.php
HTH!
Jay
--
PHP General Mailing List (h
check out preg replace in the manual... particularly example 3 of this page:
http://www.php.net/manual/en/function.preg-replace.php
personally, i'd replace anything other than a-zA-z0-9 with _
Justin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/
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("&","",$n
6 matches
Mail list logo