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

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -