At 17:58 09.11.2002, samug said:
--------------------[snip]--------------------
>$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?"
--------------------[snip]--------------------
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);
print($rest);
will correctly output "I tell you?"
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php