HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
PHP Variable Handling Reference : Check whether a variable is empty. Also check whether the variable is set/declared
The empty() function checks whether a variable is empty or not.
This function returns false if the variable exists and is not empty, otherwise it returns true.
The following values evaluates to empty:
Parameter | Description |
---|---|
variable | Required. Specifies the variable to check |
Return Value: | FALSE if variable exists and is not empty, TRUE otherwise |
---|---|
Return Type: | Boolean |
PHP Version: | 4.0+ |
PHP Changelog: | PHP 5.5: Support for expressions, not only variables PHP 5.4: Non-numeric offsets of strings returns TRUE |
❮ PHP Variable Handling Reference