i have this situation:
print_r($test);
echo '<br>';
$and = '';
for ($i=0; $i<$count; $i++){
$and.= ' u.room = '.$test[$i];
$and.= ' OR ';
}
the result will be :
Array ( [0] => 1 [1] => 3 [2] => 4 [3] => 5 [4] => 6 )
u.room = 1 OR u.room = 3 OR u.room = 4 OR u.room = 5 OR u.room = 6 OR
what i want is to remove the last ‘OR’ so the string will become: u.room = 1 OR u.room = 3 OR u.room = 4 OR u.room = 5 OR u.room = 6
any ideas?
Thanks
1 Answer