Re: Replace a space with _

From: Date: Thu, 11 Jan 2001 23:56:25 +0000
Subject: Re: Replace a space with _
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-34160@lists.php.net to get a copy of this message
Also consider : $filezip_name = str_replace(' ', '_', $filezip_name); http://php.net/manual/function.str-replace.php It will be faster. Philip On Thu, 11 Jan 2001, Chris Lee wrote: > just add this somewhere near the top. > > $filezip_name = ereg_replace(' ', '_', $filezip_name); > > Chris Lee > Mediawaveonline.com > > > > ""David Smith"" <webmaster@indywebdesign.com> wrote in message > news:MABBLAPKMKCPAFPFGAJKMEGJCBAA.webmaster@indywebdesign.com...ÀW¼Ó¥4_Kj > ‰ÙW#K > > > > With the following code how can I check to see if the file being uploaded > > has a space in it? Maybe replace them with a _ or reject them all > > together... > > > > if ($FileType== "none") { > > print "ERROR! - You must specify a File Type before we can begin the > > upload.<BR>"; > > } > > else { > > > > if ($filezip== "none") { > > print "ERROR! - You must specify a zip file to upload.<BR>"; > > } > > else { > > copy($filezip, "/home/sites/site1/ftp/$FileType/$filezip_name"); > > unlink($filezip); > > } > > > > > > > > WreckRman2 > > Combat Flight Center > > http://www.combatfs.com > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#34160) next »