hey, is it possible to break; a while loop?
if not, how can it be done?
| SitePoint Sponsor |

hey, is it possible to break; a while loop?
if not, how can it be done?
>> hey, is it possible to break; a while loop?
Yes,
example:
PHP Code:$i = 0;
while ( 1 ) {
if ( $i++ > 5 ) {
break; // <<-- force the exit from the while loop
}
}
:-) Andrea

ah, thanks. i feel like an idiot. i didn't have another variable set right, and therefore didn't break; my while loop.Originally Posted by pippo
but hey, gotta look stupid sometimes to find the answers!
thanks!
Bookmarks