Answers for "check object is empty or not in php"

PHP
5

php code to check if variable is null

if(empty($var1)){
    echo 'This line is printed, because the $var1 is empty.';
}
Posted by: Guest on May-01-2020
1

php check of object is empty

$arr = (array)$obj;
if (!$arr) {
    // do stuff
}
Posted by: Guest on September-23-2021
3

php check for empty string

if (empty($var)) {
    echo '$var is either 0, empty, or not set at all';
}
Posted by: Guest on March-07-2020
0

php check if object is empty

if($users->count()==0){
					$result->errer = "not exist";
				}
Posted by: Guest on August-15-2021

Code answers related to "check object is empty or not in php"

Browse Popular Code Answers by Language