Answers for "if object empty php"

PHP
6

is null php

// The is_null() function checks whether a variable is NULL or not. This function returns true (1) if the variable is NULL, otherwise it returns false/nothing.

<?php
    $var = NULL;  
	if (is_null($var)) {
      	echo "yes, is null";
      
    } else {
      	echo "not null";
    }
?>
Posted by: Guest on October-15-2020
4

php empty object

$x = new stdClass();
Posted by: Guest on February-19-2020
0

php if isset

if (isset(true)) {
}
Posted by: Guest on February-07-2021

Browse Popular Code Answers by Language