What's wrong with OR?
Anyway, i guess that you want to repeat OR for as long as you have some $search to look for. Maybe this function will come in handy:
function build_sql_string($array)
{
$lastkey = count($array)-1;
foreach($array as $key => $value)
{
if($key != $lastkey)
{
$string = $string."'".$value."' OR";
}else{
$string = $string."'".$value."'";
}
}
return($string);
}
just feed it an array for instance:
$array[1] = "test";
$array[2] = "test2";
call build_sql_string
build_sql_string($array);
and it will return a string like this:
$string = "test OR test2";
Hope you'll figure out the rest...