Re: Switch statement || How to output html without using echo() or print()
| From: | CF High | Date: | Sat, 25 Jan 2003 20:46:06 +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-133117@lists.php.net to get a copy of this message | ||
Thanks for the informative response, Leif.
Looks like you and Johannes are on the same page -- these solutions save a
great deal of time.
Thanks,
--Noah
"Leif K-Brooks" <eurleif@buyer-brokerage.com> wrote in message
news:3E32C749.8010302@buyer-brokerage.com...
> No. You can either echo/print with a heredoc (which is still
> echoing/printing, but is a lot easier) or you can exit PHP. For example:
> <?php
> switch($somevar){
> case 'case1':
> print <<< END
> some html
> some html
> some html
> END;
> break;
> case 'case2':
> print <<< END
> some html
> some html
> some html
> END;
> break;
> }
> ?>
>
>
> Or:
> <?php
> switch($somevar){
> case 'case1':
> ?>
> some html
> some html
> some html
> <?php
> break;
> case 'case2':
> ?>
> some html
> some html
> some html
> <?php
> break;
> }
> ?>
>
> CF High wrote:
>
> >Hey all.
> >
> >Don't know if this is possible, but here goes:
> >
> >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!?
> >
> >I'm new to PHP so pardon my ignorance here. I'm used to the relative
ease
> >of Cold Fusion............
> >
> >Thanks for any ideas/suggestions,
> >
> >--Noah
> >
> >--
> >
> >
> >
> >
> >
> >
>
> --
> The above message is encrypted with double rot13 encoding. Any
unauthorized attempt to decrypt it will be prosecuted to the full extent of
the law.
>
>
>