I have this little script and function:
function control($value,$position)
{
if ($_SERVER['REMOTE_ADDR']=="".$value."" && $position==0)
{
print "".$value." $x<br>";
return;
}
else
{
control($value,$position);
usleep(20);
}
}
$x=0;
foreach($aa as $aaa)
{
$exp=explode("-",$aaa);
$exp2=explode("_",$exp[1]);
control($exp2[0],$x);
$x++;
}
The loop takes values from a file and sends them to a function to verify, in the function for example if value is the same as the IP of a user it works and if not it continues to execute the function. If not, the idea it repeats to continue verification; the function stops when finally the function verifies this value and it is ok.
I need this to work in one only load, for this I am thinking to use the sleep and repeat functions because the time difference for verification is very low, but in some moments more than 3 users can need to verify this.
The most important for me is to know I can do this in the function because if I use it in this way all the time the page tells me the connection is down, and I only need to repeat the function when the verification result is not the same, and if it is not the same repeat the function another time inside the loop and sleep and repeat in the wait mode.
Sorry but I try to tell all this the best I can.
Regards and thanks.