Handy for creating a search query.
There's a suggested answer on the messageboard, but I think this is cleaner.
There's a suggested answer on the messageboard, but I think this is cleaner.
Code:
$phrases = explode('"', $q);
foreach ($phrases as $k => $v) {
if (!$v) continue;
if ($k % 2) {
$filters[] = $v;
continue;
}
$a = explode(' ', $v);
foreach ($a as $word) {
if (!$word) continue;
$filters[] = $word;
}
}
print_r($filters);
exit;
Comment