A newbie question here....I have a while loop that I want to restrict based on the looped counter. Here is what I have so far:
function somefuntion()
{
$tmp = 1;
while (somefunction(using $tmp) < target) {
$tmp ++;
}
return $tmp;
}
I understand that I should use while ($tmp < 500), but $tmp is being used in a function and I want the formula to keep looping until it is equal to the target value.
I tried adding while ($tmp < 500) before the while (somefunction()) and also adding an if ($tmp < 500), but it seems that the while loop overrides this.
I'm sure there is a simple solution, I just can't quite get my head around loops.
Thanks,
Peter.