empty variable in php code example
Example 1: php check for empty string
if (empty($var)) {
echo '$var is either 0, empty, or not set at all';
}
Example 2: declare empty array in php
$emptyArray = [];
$emptyArray = array();
$emptyArray = (array) null;
Example 3: php check empty variable
empty var php