In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-13 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of "what is the meaning of empty in php". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this article "what is the meaning of empty in php" can help you solve the problem.
In PHP, empty means empty, is a built-in function, used to check whether a variable is empty, the syntax is "empty (mixed $var)"; when the variable does not exist or the value of the variable is used for false, the variable is judged to be nonexistent, and the empty () function does not generate a warning.
This article operating environment: Windows10 system, PHP7.1 version, Dell G3 computer.
Empty in php
Empty means null, which is a built-in function in php to check whether a variable is empty.
Empty () determines whether a variable is considered empty. When a variable does not exist, or when its value is equal to FALSE, then it is considered nonexistent. Empty () does not generate a warning if the variable does not exist.
Grammar
Bool empty (mixed $var)
Parameter description:
Var: the variable to be checked.
Note: prior to PHP 5.5, empty () only supported variables; anything else would cause a parsing error. In other words, the following code will not take effect:
Empty (trim ($name))
Instead, you should use:
Trim ($name) = = false
Empty () does not generate a warning, even if the variable does not exist. This means that empty () is essentially equivalent to! isset ($var) | | $var = = false.
Return value
Returns FALSE if var exists and is a non-empty non-zero value. Otherwise, TRUE is returned.
The following variables 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)
This is the end of the content about "what is the meaning of empty in php". Thank you for your reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.