Re: If/else conditional statement ...
| From: | Casey Allen Shobe | Date: | Mon, 24 Dec 2001 03:35:01 +0000 |
| Subject: | Re: If/else conditional statement ... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-78640@lists.php.net to get a copy of this message | ||
On Sunday 23 December 2001 03:11 pm, Robert Dyke wrote:
> <% If $varA == True Then %>
> Straight HTML in here that only displays if $varA == True
> <% Else %>
> Straight HTML in here that only displays if $varA != True
> <% End if %>
<?php if $varA == true) { ?>
<b>$varA was true.</b>
<?php } else { ?>
<b>$varA was false.</b>
<?php } ?>
I heavily dislike this coding style, however, and personally would use
something like this:
<?php
print ('<b>$varA was ');
if ($varA == true) {
print ('true');
} else {
print ('false');
}
print ('.</b>'."\n");
?>
--
Casey Allen Shobe
cshobe@softhome.net