How to use the empty () function in php
This article mainly shows you "how to use the empty () function in php", which is easy to understand and clear. I hope it can help you solve your doubts. Let me lead you to study and learn how to use the empty () function in php.
Empty ():
Determine whether the variable is empty
Returns FALSE if var exists and is a non-empty, non-zero value, otherwise returns TRUE.
The following things are considered empty:
"" (empty string)
0 (0 as an integer)
0.0 (as 0 of a floating point number)
"0" (as 0 of the string)
NULL
FALSE
Array () (an empty array)
$var; (a variable that is declared but has no value)
/ / empty (): determine whether the variable is empty $name =''; if (empty ($name)) {echo'is empty; / / empty} else {echo 'not empty';} above is all the content of the article "how to use the empty () function in php". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!