I have a problem separting a text string with the preg_split function
If somebody could help, it would be greatly appreciated.
-
The problem I have is that my code, so far, does the job, except it
recognises ALL : and not only those following PAGE.
This should be fairly easy to solve?
On Wednesday 10 March 2004 19:53, [EMAIL PROTECTED] wrote:
I have a problem separting a text string with the preg_split function
If somebody could help, it would be greatly appreciated.
-
The problem I have is that my code, so far, does the job, except it
recognises ALL : and not only
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?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
list throws away the other two array elements, you need
list($one,$two,$three,$rest) = preg_split(/\s+/, $text, 4);
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
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 =
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
6 matches
Mail list logo