What is the difference between the WHILE LOOP statement and the IF statement in...

Tony

New member
...this particular PHP case? Ok ...I am using this example here .. This loop is supposed to test that there we havent reached the end of the file using the feof() function.

while (!feof($fp))
{

$order = fgets($fp,999);

echo $order;

}


WHY DONT I GET THE SAME RESULT as the while loop when using an IF STATEMENT.. logically they're supposed to give me the same result

if (!feof($fp))
{

$order = fgets($fp,999);

echo $order;

}
 
Back
Top