variables - PHP assign first not null, set and not empty value -


i partially solved line above setup variable different others got post method

$myvar= $_post['myvar_a'] ?: $_post['myvar_b'] ?: $_post['myvar'] ?: null; 

but need take care of not set , empty value. when not set myvar_a , myvar_b take myvar, otherwise force null because have set in current execution. achieved nested if else pseudo

if isset , !empty myvar = myvar_a else ... 

but shorten code. tips?


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -