conceptual - difference between these two return statements in php -
we wondering best way return empty null no result in php, use this
function dothis($a){ if($a == 0){ return ''; }else{ // complex mysql return $result; } one more way of doing
function dothis($a){ if($a == 0){ return null; }else{ // complex mysql return $result; } now compare this
if(dothis(5)){ // } or
if(!is_null(dothis(5)){ // } i wondering best approach doing ?
there problem in function dothis near if($a = 0){.
== used compare.
= used assign value.
Comments
Post a Comment