Re: [PHP] Re: Separating spaces from the rest

2004-05-01 Thread Anguz
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

[PHP] Re: Separating spaces from the rest

2004-04-30 Thread Justin Patrin
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] =>

Re: [PHP] Re: Separating spaces from the rest

2004-04-30 Thread Curt Zirzow
* 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

[PHP] Re: Separating spaces from the rest

2004-04-30 Thread Anguz
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]