if else and elseif statements...
| From: | Prince | Date: | Sat, 03 May 2003 00:00:27 +0000 |
| Subject: | if else and elseif statements... | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-9456@lists.php.net to get a copy of this message | ||
had a quick question about if else and elsif tags...
in the display for my web pages i need to see if a var is empty and if so show nothing at all
otherwise if it is full then show its content.. so could i do something like this:
{if $member[members_show].AreaCode2 == ""&& $member[members_show].Exchange2 ==
"" && $member[members_show].Number2 == ""}
{else}
({$member[members_show].AreaCode2}){$member[members_show].Exchange2}-$member[members_show].Number2}<br>
{/if}
...
output should be something like this:
(if empty show nothing..not even a table row for that set)
otherwise if all 3 vars are full get output something like this:
(123)456-7890
should that work?