On Sunday 10 November 2002 00:58, samug wrote: > Could someone tell me why isn't this working? > > $text = "And what did I tell you?"; > list($one,$two,$three,$rest) = preg_split("/\s+/", $text); > print($rest); > > The result would be "I" and not "I tell you?" > Why?
Because that is what you asked for! $doo = preg_split("/\s+/", $text); print_r($doo); // each word is a separate element in $doo. In your list() you're only taking up to the 4th element which is "I". -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Something unpleasant is coming when men are anxious to tell the truth. -- Benjamin Disraeli */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php