Re: [PHP] Replace a space with a newline every 2 spaces

2010-04-22 Thread Andrew Ballard
On Thu, Apr 22, 2010 at 1:29 PM, Paul Halliday wrote: > Ex: > > "This is the string and it is this long" > > This is > the string > and it > is this > long > > I found some long functions to achieve this but I couldn't help but > think that it could be done in a couple lines. > > Possible? > > Tha

[PHP] Replace a space with a newline every 2 spaces

2010-04-22 Thread Paul Halliday
Ex: "This is the string and it is this long" This is the string and it is this long I found some long functions to achieve this but I couldn't help but think that it could be done in a couple lines. Possible? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: ht

Re: [PHP] Replace a space with _

2001-01-11 Thread Philip Olson
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); >

Re: [PHP] Replace a space with _

2001-01-11 Thread Chris Lee
just add this somewhere near the top. $filezip_name = ereg_replace(' ', '_', $filezip_name); Chris Lee Mediawaveonline.com ""David Smith"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > With the following code how can I check to see if the file being upl

[PHP] Replace a space with _

2001-01-11 Thread David Smith
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."; }