Link to home
Start Free TrialLog in
Avatar of BR
BRFlag for Türkiye

asked on

if statement if (!empty

would it be correct to write it like this?
if (!empty($value1)) || (!empty($value2)) || (!empty($value3)) || (!empty($value4))
ASKER CERTIFIED SOLUTION
Avatar of DangerousJeff
DangerousJeff
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BR

ASKER

thank you
Avatar of Beverley Portlock
Are you sure you mean || and not && ? I've noticed that people often invert their logic when NOT conditions turn up. Your IF will be true if any of them are non-empty.