In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Garth Dahlstrom) wrote:

> > $sometext2split = "hello world  with    a  lot   of    whitespaces!";
> > $myarray = preg_split ("/\s+/",$sometext2split);
> > 
> > you should get
> > $myarray := ['hello', 'world', 'with', 'a', 'lot', 'of', 'whitespaces!']
> 
> That's not what I'm after though.... 
<snip>
> I'd be happy if I could even get:
> $myarray = ["hello ", "world  ","with    ","a  ","lot   ",
> "of    ","whitespaces!"]
> 
> 'cause I could spell check based on trimming the entry.

Maybe you've already tried this and rejected this for some reason, but my 
inclination would be to split on "\b" (the non-character boundary between a 
"\s+" next to a "\w+").

-- 
CC

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to