public static function wordsTokenized($string)
    {
        for ($tokens = array(), $nextToken = strtok($string, ' '); $nextToken !== false; $nextToken = strtok(' ')) {
            if ($nextToken{0} == '"')
                $nextToken = $nextToken{strlen($nextToken)-1} == '"' ?
                                '"' . substr($nextToken, 1, -1) . '"'
                              : '"' . substr($nextToken, 1) . ' ' . strtok('"') . '"';

            $tokens[] = $nextToken;
        }
        return $tokens;
    }
public static function wordsTokenized($string)
    {
        for ($tokens = array(), $nextToken = strtok($string, ' '); $nextToken !== false; $nextToken = strtok(' ')) {
            if ($nextToken{0} == '"')
                $nextToken = $nextToken{strlen($nextToken)-1} == '"' ?
                                '"' . substr($nextToken, 1, -1) . '"'
                              : '"' . substr($nextToken, 1) . ' ' . strtok('"') . '"';

            $tokens[] = $nextToken;
        }
        return $tokens;
    }
public static function wordsTokenized ( $ string ) { for ( $ tokens = array ( ) , $ nextToken = strtok ( $ string , ' ' ) ; $ nextToken !== false ; $ nextToken = strtok ( ' ' ) ) { if ( $ nextToken { 0 } == '"' ) $ nextToken = $ nextToken { strlen ( $ nextToken ) - 1 } == '"' ? '"' . substr ( $ nextToken , 1 , - 1 ) . '"' : '"' . substr ( $ nextToken , 1 ) . ' ' . strtok ( '"' ) . '"' ; $ tokens [ ] = $ nextToken ; } return $ tokens ; }
Splits a string into an array, exploded by spaces.
However, it takes "quoted strings" into account,
will count them as a single item.

@param string $string String to split

@see    http://us2.php.net/manual/en/function.strtok.php#53244
@author brian dot cairns dot remove dot this at commerx dot com

@return array An array containing the split words
Splits a string into an array exploded by spaces . However it takes quoted strings into account will count them as a single item .