Re: [PHP] preg_split problem

2004-03-11 Thread Jason Wong
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 no

Re: [PHP] preg_split problem

2002-11-09 Thread Ernest E Vogelsinger
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 rege

Re: [PHP] preg_split problem

2002-11-09 Thread Jason Wong
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 aske

Re: [PHP] preg_split problem

2002-11-09 Thread Marek Kilimajer
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 re