Re: html code blocks
| From: | Dean Hall | Date: | Wed, 23 Aug 2000 21:35:03 +0000 |
| Subject: | Re: html code blocks | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-13225@lists.php.net to get a copy of this message | ||
On Wed, 23 Aug 2000, Brad Sacks wrote:
> I have been exposed to a lot of asp in the last few months and there is
> a cool thing that it can do. That is get around echo (response.write)
> statements, like this;
> <% if blah then%>
>
> <html code block>
>
> <%else if blah%>
>
> <html code block>
>
> <%end if%>
>
> asp will actually load the html inside the condition statement that is
> met and ignore the rest. Of coarse asp has a lot of other things that
> suck, but this is cool. I am pretty new to both asp and php, but can php
> do this?. Does it work the same way?
<? if(condition): ?>
<some html here>
<? else if(conditional): ?>
<some html here>
<? endif; ?> // I think that's right -- or do the following:
<? if(condition) { ?>
<some html here>
<? } else if(condition) { ?>
<some html here>
<? } else { ?>
<some html here>
<? } ?>
Dean.