$word){ $found = false; foreach (array('+', '-', '<', '>', '~', '*') as $Operator) if (substr($word, 0, 1) == $Operator) $found = true; if (!$found) $words[$k] = '+' . $word; } } foreach ($words as $k=>$word) $words[$k] = '"' . $word . '"'; return $words; } ?>