FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » terminate a PHP script
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: terminate a PHP script [message #172559 is a reply to message #172546] Mon, 21 February 2011 21:03 Go to previous messageGo to previous message
sheldonlg is currently offline  sheldonlg
Messages: 166
Registered: September 2010
Karma:
Senior Member
On 2/21/2011 1:54 PM, n00m wrote:
>
>> Again, why not if-then-else?
>
> what if it's 10 nested for() stmts?
> And you need to break out of ALL for()'s from the innermost for()?
> Do you like 10 if-then-else conditionals, 1 per each for()?

&& !$exit_all

in each of the test conditions of the for loop where $exit_all is
initially FALSE outside the outermost loop.

for ($i1=0, $exit_all=FALSE; $i1 < $i1_end && !$exit_all; $i1++) {
for ($i2=0, $exit_all=FALSE; $i2 < $i2_end && !$exit_allt; $i2++) {
..... // and so on
if ($some_condition == TRUE) {
$exit_all = TRUE;
break; // or continue which does one extra check step
}
}
}



--
Shelly
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Extralight browser-webserver communication via cookies (+)
Next Topic: Storing multiple character set types (or a representation of em) in a table column
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 01:37:54 GMT 2024

Total time taken to generate the page: 0.20965 seconds