Menu
What am I doing wrong here ?
[code=php]
$operator = “randomtxt”;
$i = 1;
foreach ($_GET as $key => $value) {
if (stristr($key,’phone’) && (strlen($value) > 0)) {
echo $i;
if ($i == 1) {
$operator=””;
}
$what .= ” “.$operator.” `handsets` LIKE ‘%”.$value.”%’ “;
echo $operator;
$i++;
}
the echo from $i outputs “1234” so it goes up each time, however it sets $operator = “” in each loop, so operator is always empty, even though it’s if $i == 1 and $i is sometimes equal to 2 or 3!!
Wel confused, can’t think what i’ve missed now!
Thank you ?