|
emptyDetermine whether a variable is empty Description
bool empty
( mixed
$var
)
Determine whether a variable is considered to be empty. A variable is considered empty if it does not exist or if its value equals Parameters
Return Values
Returns The following things are considered to be empty:
Changelog
Examples
Example #1 A simple empty / isset comparison.
<?php Example #2 empty on String Offsets PHP 5.4 changes how empty behaves when passed string offsets.
<?php Output of the above example in PHP 5.3: bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) Output of the above example in PHP 5.4: bool(true) bool(false) bool(false) bool(false) bool(true) bool(true) Notes
|