php - How to check multiple variables if has values? -
how can check if has values if 1 missing echo else. try isset same, miss think.
$da1="da1"; $ba2=""; $za3="za3"; if (!empty($da1)||!empty($ba2)||!empty($za3)) { echo $da1.$ba2.$za3; }else{ echo "one missing"; }
my output :
da1za3
use && instead ||
if (!empty($da1) && !empty($ba2) && !empty($za3)) { echo $da1.$ba2.$za3; }else{ echo "one mising"; }
Comments
Post a Comment