RE: [PHP] Function Reqest/Question
Personally, I kind of like: switch(1){ default: // BREAK BLOCK START blah blah blah... // Want to get out of here... break; } // BREAK BLOCK END It's a little more cumbersome than the while construct, but it is absolutely guaranteed to only go through once, whilst the while version you HAVE to rememeber to put in the closing break, otherwise you risk an infinite loop. At 16:25 2/07/2001 -0400, Matthew Loff wrote: The best way I've seen this done is: ?php while(0) ( ... and it should be while(1) ) { blah blah blah... // Want to get out of here... break; } ? But putting it within while(0), you can simply break; from it... There may be better ways... Any other suggestions? - Brian White Step Two Designs Pty Ltd - SGML, XML HTML Consultancy Phone: +612-93197901 Web: http://www.steptwo.com.au/ Email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Function Reqest/Question
i dont know of a function to skip to the end of the nearest ?, and i suspect that there isn't one... you can use other control func's to do what you need, in the context that you're working in... read up on: goto, break, continue, return -Original Message- From: Anil [mailto:[EMAIL PROTECTED]] Subject: [PHP] Function Reqest/Question Is there a func() that will let me break or skip to the END of the ? ? code snippet? I have a file that contains both HTML and PHP. html header code ? if condition skip; ... php code ... ? html footer code I know there are several ways of attacking this. Including making a func() that outputs the footer - skip() containing a bunch of print statements with the footer html. ... I was hoping for a straight forward solution built into php. I tried to use return 0; but that didn't work it seems to stop loading the rest of the page. Thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Function Reqest/Question
The best way I've seen this done is: ?php while(0) { blah blah blah... // Want to get out of here... break; } ? But putting it within while(0), you can simply break; from it... There may be better ways... Any other suggestions? -Original Message- From: scott [gts] [mailto:[EMAIL PROTECTED]] Sent: Monday, July 02, 2001 3:33 PM To: php Subject: RE: [PHP] Function Reqest/Question i dont know of a function to skip to the end of the nearest ?, and i suspect that there isn't one... you can use other control func's to do what you need, in the context that you're working in... read up on: goto, break, continue, return -Original Message- From: Anil [mailto:[EMAIL PROTECTED]] Subject: [PHP] Function Reqest/Question Is there a func() that will let me break or skip to the END of the ? ? code snippet? I have a file that contains both HTML and PHP. html header code ? if condition skip; ... php code ... ? html footer code I know there are several ways of attacking this. Including making a func() that outputs the footer - skip() containing a bunch of print statements with the footer html. ... I was hoping for a straight forward solution built into php. I tried to use return 0; but that didn't work it seems to stop loading the rest of the page. Thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]