Curt Zirzow wrote:
You forgot the pattern deliminator:
print_r(preg_split('/(\s+)/', " word1 word2 word3.", -1, PREG_SPLIT_DELIM_CAPTURE));
Curt
You're right, that fixed the space capturing.
Justin Patrin wrote:
> ...I wonder why you're doing this, but here's an answer for you.
>
> BTW, if
Anguz wrote:
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));
I get this:
Array
(
[0] =>
[1] => word1
[2] =>
* Thus wrote Anguz ([EMAIL PROTECTED]):
> 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
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));
I get this:
Array
(
[0] =>
[1] => word1
[2] => word2
[3]
4 matches
Mail list logo