Re: Switch statement || How to output html without using echo() or print()

From: Date: Sat, 25 Jan 2003 20:31:35 +0000
Subject: Re: Switch statement || How to output html without using echo() or print()
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-133115@lists.php.net to get a copy of this message
That does the trick, although I'm not exactly sure why. Shouldn't the html between the <?php case 1: ?> and <?php break; }: ?> statements be executed regardless of whether or not case 1 matches the switch variable? In Cold Fusion anything outside of <cfoutput>cf code here</cfoutput> is ignored by the CF language processor; thus the <?php case 1?> html here <?php break; }?> would display the html for each case. In any case thanks for workaround -- I would have echoed out all the html otherwise.......... --Noah ----- Original Message ----- From: "Johannes Schlueter" <php@schlueters.de> To: "CF High" <noah@newminddesign.com>; <php-general@lists.php.net> Sent: Saturday, January 25, 2003 8:38 AM Subject: Re: [PHP] Switch statement || How to output html without using echo() or print() > On Saturday 25 January 2003 20:38, CF High wrote: > > > Each operation has @ 50 lines of html -- do I have to echo or print all > > this html!? > > Try something like > <?php > switch ($foo) { > case 1: > ?> > <h1>Hello</h1> > <?php > break; > } > ?> > > johannes >

« previous php.general (#133115) next »