Hi,
Is there an equivalent to the C++ 'break' command to stop execution of a for
loop? I know I can use 'goto' but I don't want to unless I have to.

for ($i=0; $i<$n; $i++)
    if (some condition)
        break;

And, what about 'continue' which skips the rest of the code in the for loop
and immediately goes on to the next iteration?

Thanks,

Rich

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to