My For loop headache, please help
Posted: Fri Jul 01, 2005 8:10 am
Hi,
Here is my for loop for showing available IP addresses within my database. It creates an array with the taken ones and looks for available ones within the range ---- WELL, AT LEAST THAT IS WHAT IT SHOULD DO
The echo $found_ip outputs a result of zero. It appears to be taking the variable from the first line without using the For loop. I need to combine the $found_ip with the For loop somehow.
Please help
Here is my for loop for showing available IP addresses within my database. It creates an array with the taken ones and looks for available ones within the range ---- WELL, AT LEAST THAT IS WHAT IT SHOULD DO
Code: Select all
$found_ip = 0;
for($counter = 1; $counter >= 255; ++$counter){
if(!in_array('192.168.241.'.$counter,$ips)){
$found_ip = ('192.168.241.'.$counter);
}
}
echo $found_ip;Please help