In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article introduces the knowledge of "the usage of isset () and! empty () function in PHP". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
The isset () function is a built-in function in PHP that checks whether the variable is set and is not NULL. This function also checks whether the declared variable, array, or array key has a null value, and if so, isset () returns false, which returns true in all other possible cases.
Syntax:
Bool isset ($var, mixed)
Parameters: this function accepts multiple parameters. The first argument to this function is $var. This parameter is used to store the value of the variable.
Example:
Output:
0 isset with isset functionarray is not set.
The empty () function is a language construct that determines whether a given variable is empty or NULL.! The empty () function is a negation or supplement to the empty () function. The empty () function and! The isset () function is equivalent, but! The empty () function equals the isset () function.
Example:
Output:
0 is considered empty1 is considered set
Check the reasons for the two functions:
Isset () and! The empty () function is similar, and both will return the same result. But the only difference is! The empty () function does not generate any warnings or electronic notifications when the variable does not exist. It is sufficient to use any function. Merging the two functions into the program can lead to the passage of time and unnecessary memory use.
Example:
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.