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 will explain in detail how to use PHP = =. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
The frequency of the PHP comparison operator is too high, especially the = =
If (a = = b) {
/ / do something
}
But have you really mastered "="? Details are important!
Take a look at the following code and say what you think is the right answer
Var_dump ('123fg456'==123)
Var_dump ('some string' = = 0)
Var_dump (123.0 = '123d456')
Var_dump (0 = "a")
Var_dump ("1" = = "01")
Var_dump ("1" = = "1e0")
Figure out your answer first, and then run it again. If the answer is not wrong, then congratulations, the basic knowledge is very solid.
Explanation:
If you compare an integer and a string, the string is converted to an integer. If two numeric strings are compared, they are compared as integers. This rule also applies to switch statements.
In particular, when a string is converted to an integer, it is from left to right until a non-numeric character is encountered. That means' 123abc456 'will be converted to 123 instead of 123456. In addition, the space at the beginning of the string is ignored, such as converting '234abc' to 234.
A comparison table of loose comparison and strict comparison is attached below.
This is the end of the article on "how to use PHP". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
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.