At 17:58 09.11.2002, samug said:
>$text = "And what did I tell you?";
>list($one,$two,$three,$rest) = preg_split("/\s+/", $text);
>The result would be "I" and not "I tell you?"

Your regex splits the entire string, and since you have only a list of four
elements, the fourth element happens to be the "I".

If you want the rest in $rest, you need a thried parameter to preg_split
telling it how many elements the resulting array should have:

$text = "And what did I tell you?"; 
list($one,$two,$three,$rest) = preg_split("/\s+/", $text, 4); 

will correctly output "I tell you?"

   >O     Ernest E. Vogelsinger
   (\)    ICQ #13394035

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to