Re: Switch statement || How to output html without using echo() or print()
| From: | Noah | Date: | Sat, 25 Jan 2003 20:42:09 +0000 |
| Subject: | Re: Switch statement || How to output html without using echo() or print() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-133116@lists.php.net to get a copy of this message | ||
Hey John.
While your suggestion certainly will work, I'd prefer not to have an
excessive number of include files to keep track of.
Johannes' suggestion does the trick:
"Try something like
<?php
switch ($foo) {
case 1:
?>
<h1>Hello</h1>
<?php
break;
}
?>"
----- Original Message -----
From: "John W. Holmes" <holmes072000@charter.net>
To: "'CF High'" <noah@newminddesign.com>;
<php-general@lists.php.net>
Sent: Saturday, January 25, 2003 8:42 AM
Subject: RE: [PHP] Switch statement || How to output html without using
echo() or print()
> > I've got a simple switch statement that carries out one of several
> > operations based on the switch statement variable value.
> >
> > Each operation has @ 50 lines of html -- do I have to echo or print
> all
> > this
> > html!?
>
> You could put your HTML into a separate file and just include() it
> wherever you want it displayed...
>
> ---John W. Holmes...
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
>
>