The following two if
s produced different results(first if
echos hi, second does not), why? why didn't the variable assignment on $t
work? is this due to $t
's local scope inside the if
conditional?
if(isset($_REQUEST["test"]) && $t=trim($_REQUEST["test"]) && !empty($t)){
echo 'hi'
}
if(isset($_REQUEST["test"]) && $t=trim($_REQUEST["test"])){
if(!empty($t))echo 'hi'
}