Conditional display
-
How can I display a field conditionally ? (I mean, when It’s not blank, or null)
I tried using an if statement, but no luck. The FontAwesome icon appears anyway and the information didn’t because it doesn’t exist.
<?php if($user_info->adi_phone != '' || !empty($user_info->adi_phone) || $user_info->adi_phone != ' ') { echo "<span><i class='fa fa-phone-square'></i> ".$user_info->adi_phone."</span>"; } if($user_info->adi_skype != '' || !empty($user_info->adi_skype) || $user_info->adi_skype != ' ') { echo "<p><i class='fa fa-skype'></i> ".$user_info->adi_skype."</p>"; } ?>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Conditional display’ is closed to new replies.