Re: Re: Separating spaces from the rest
| From: | Curt Zirzow | Date: | Fri, 30 Apr 2004 23:07:30 +0000 |
| Subject: | Re: Re: Separating spaces from the rest | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-185082@lists.php.net to get a copy of this message | ||
* Thus wrote Anguz (clavaque@prodigy.net.mx):
> Thanks! I was just reading that function in the manual when I got your
> reply. I tested it but I still have a couple of problems with it.
>
> print_r(preg_split('(\s+)', " word1 word2 word3.", -1,
> PREG_SPLIT_DELIM_CAPTURE));
You forgot the pattern deliminator:
print_r(preg_split('/(\s+)/', " word1 word2 word3.", -1,
PREG_SPLIT_DELIM_CAPTURE));
>
> Kemper, Helmut wrote:
> > Hi,
> >
> > See preg_explite and use "/(\s+)/" for explode string into array.
> >
Curt
--
"I used to think I was indecisive, but now I'm not so sure."