Hey guys: I’m trying to work on a function searchTerms() that takes a search string as a parameter and returns an array of all search terms in the string. Every token in the string is considered a search term, except for tokens wrapped in double quotation marks: these phrases should be treated as a single search term. You may assume that all tokens in the string are separated by exactly one space and that no search string has an odd number of double quotation marks, that is, all beginning quotation marks have a matching set of ending quotation marks. Here is what I have so far:
[php]function searchTerms($words)
{
$split = explode(" ", $words);
foreach ($split as &$values) {
if ($values == " ") {
return $values;
}
}
return $split;
}/php]
but it isn’t working, I get a notice saying it’s an array, which is not helpful.