Posted by Jason Wong on 04/11/05 09:37
On Monday 11 April 2005 09:27, Russ wrote:
> I have been trying to get the following code working. I keep getting an
> error on line nine.
And the error is?
> It looks simular to the example in the PHP online
> manual. If I substitute a print command for line nine I get the correct
> information from $_POST[username]. I must be missing or have an extra a
> quote but I cannot figure out where.
> name($fname, $lname) = split('[/\s+/]', "$_POST[username]");
split() probably uses POSIX regex and hence knows nothing about '\s'. Use
preg_split() instead:
list($fname, $lname) = preg_split('/\s+/', $_POST['username']);
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
New Year Resolution: Ignore top posted posts
[Back to original message]
|