There are such variables

$z1=''; $z2='hell'; 

How to assign z3 value by analogy with the following code?

 $z1=''; $z2='hell'; if(!empty($z1)) $z3=$z1; else $z3=$z2; 

1 answer 1

 $z3 = (empty($z1)) ? $z2 : $z1; 
  • this kind of tenars is not interested - DarkVss
  • The brackets are evil ... - Qwertiy