Better way to check variable for null or empty string?

// Function for basic field validation (present and neither empty nor only white space
function IsNullOrEmptyString($str){
    return ($str === null || trim($str) === '');
}

Leave a Comment