Re: eregi_replace() function in a script

From: Date: Sun, 01 Dec 2002 23:16:20 +0000
Subject: Re: eregi_replace() function in a script
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-126637@lists.php.net to get a copy of this message
John W. Holmes: > Yes, that's correct. That piece of the pattern matches anything that's > not a space, one or more times. > > > I tried the script by putting a space before the URL and the PHP still > > processes the data with no error. > > A space before everything is fine, as the pattern will match the > remainder of the string. If you put a ^ at the very beginning of the > pattern, that'll mean the beginning of the string must be followed by > (http), so then a space will cause the patter match to fail. ........................... Thanks for the reply John. I still don't understand the explanation. For instance, let's say I put _absolutely nothing_ in the URL textbox and then hit submit - the PHP still processes _without_ an error. It says: "Your submission -- -- has been received!" I would've thought the eregi_replace() function would've validated an entry with no characters. If you get a chance would you please try it out. Thanks again for your time. TR

« previous php.general (#126637) next »