xxxxxxxxxx
$emptyArray = [];
$emptyArray = array();
$emptyArray = (array) null;
xxxxxxxxxx
// Suppose we have an array
$array = array();
// Method 1: Using empty() function
if (empty($array)) {
echo "Array is empty";
} else {
echo "Array is not empty";
}
// Method 2: Using count() function
if (count($array) == 0) {
echo "Array is empty";
} else {
echo "Array is not empty";
}
xxxxxxxxxx
unset($foo); // $foo is gone
$foo = array(); // $foo is here again