ShaneK, on 30 Jun, 2009 - 09:20 AM, said:
I imagine there's some regex code somewhere that could do it.... That, in combination with preg_split, could help you get what you want.
Yeah, with preg_split(), doing this is completely trivial:
$array = preg_split('/ +/', $str);
That will split the array the desired way on any number of spaces. Or, if you're so inclined, you can make a small adjustment to have it split on whitespace of any kind, including newlines and tabs:
$array = preg_split('/\s+/', $str);

New Topic/Question
Reply



MultiQuote

|