Technically you are not outside of a function.

you need to use one of the include or require functions to include the file
right?

Jim Lucas
----- Original Message -----
From: "Jonathan Pitcher" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 02, 2003 2:30 PM
Subject: Re: [PHP] Break, Exit, Die, Kill, Maime and Stab


> return will work outside of functions ??
>
> That I didn't know.
>
> Thanks,
>
> Jonathan
>
> On Wednesday, July 2, 2003, at 04:28  PM, Jim Lucas wrote:
>
> > return;
> >
> > will do the trick
> >
> > Jim Lucas
> > ----- Original Message -----
> > From: "Jonathan Pitcher" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, July 02, 2003 2:09 PM
> > Subject: [PHP] Break, Exit, Die, Kill, Maime and Stab
> >
> >
> >> I have some scripting that includes files.  The included files are
> >> executed and everything works great.
> >>
> >> The included page needs to check multiple information.
> >>
> >> Currently if I want the scripts to end correctly I have to:
> >>
> >>
> >> if ()
> >> {
> >> }
> >> else
> >> {
> >> if ()
> >> {
> >> }
> >> else if ()
> >> {
> >> }
> >> }
> >>
> >> You get the picture.  Code gets hard to read with so many If's and
> >> Elses.
> >>
> >> I would love to:
> >>
> >> if()
> >> {
> >> //Blah
> >> break;
> >> }
> >>
> >> and have that break only stop the rest of the execution of the include
> >> file but allow the script that included it to finish running.
> >>
> >> I have tried break, exit and die with no luck.  Even tried break 1;
> >> and
> >> break 2; to break out of levels but that didn't seem to work either.
> >>
> >> Is there a solution or should I continue to do what I have done.
> >>
> >> Thanks in advance,
> >>
> >> Jonathan Pitcher
> >>
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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

Reply via email to