Posted by Oli Filth on 07/01/05 16:10
liam193 said the following on 01/07/2005 14:00:
> I'm assuming this is an easy question and I'm just missing something.
> I need to be able to explode a string on whitespace. The issue here is
> that I want to explode it such that all contiguous whitespace is one
> explode point. For example the following strings would all produce
> the same array of "words":
>
> This is a test.
> This is a test.
> This\tis a test.
> This\t \tis a test.
>
> Thoughts?
>
preg_split('/\d+/', $str);
--
Oli
[Back to original message]
|