Avatar of BrighteyesDesign
BrighteyesDesign
Flag for Afghanistan asked on

Display content depending on multiple values

I am displaying an element on  a page depending on whether the element 'SSContact' is empty or not...

<?php if(!empty($row_Diolist['SSContact'])): ?>

What I need to do is show that contact box if there is a a value in either SSContact, SSPhone or SSEmail so along the lines of...

<?php if(!empty($row_Diolist['SSContact'])): OR if(!empty($row_Diolist['SSphone'])):  OR if(!empty($row_Diolist['SSemail'])):?>

I know the code above is wrong but any ideas on how it should be?


contact box
PHP

Avatar of undefined
Last Comment
Ray Paseur

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Radek Baranowski

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Ray Paseur

Please see http://www.php.net/manual/en/language.operators.logical.php

Are you thinking of displaying whatever information is available?  For example, would you display the SSContact and SSemail if that is all the data you have?  If so, a little more logic might be in order.  Pidgin example:

if (SSContact)
{
    display SSContact
    if (SSphone) display SSphone
    if (SSemail) display SSemail
}
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck