In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
In this article, the editor gives you a detailed introduction of "what does php & & refer to". The content is detailed, the steps are clear, and the details are handled properly. I hope this "php & & what does it mean" article can help you solve your doubts? let's follow the editor's ideas to learn new knowledge.
In php, "& &" means "and" and is a logical operator that represents "logical and" and its operation results in a Boolean value; when using "& &", only the left and right expressions are TRUE at the same time, the result is TRUE; when either expression is FALSE, the result is FALSE.
Operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
In php, "& &" means "and" and is a logical operator that represents "logical and".
Logical operators are usually used to combine multiple expressions. The result of a logical operator is a Boolean, and there can only be two results, either true or false.
Logical operator example when the result is true & & or and (logical and) $m & & $n or $m and $n when both $m and $n are true, and the result is false when either of $m and $n is false
The relationship between "&" or "and" logic and
When both the left and right expressions are TRUE, the result is TRUE;. If either of the two conditions is FALSE, the result is FALSE. When the condition on the left is FALSE, it will skip the condition on the right and return to FALSE directly.
Logic and is a kind of short-circuit logic. If the left expression is false, the result is returned directly by short-circuit, and the right expression is no longer evaluated. The operation logic is as follows:
Step 1: calculate the value of the first Operand (left expression).
Step 2: detect the value of the first Operand. If the value of the first Operand can be converted to false (such as null, undefined, NaN, 0, ", false), the operation ends directly and returns false.
Step 3: if the first Operand can be converted to true, the value of the second Operand (the expression on the right) is calculated.
Step 4: if the second Operand can be converted to true, then true; if the second Operand can be converted to false, then false.
[example] assume that the conditions for conscription are met between the ages of 18 and 25, and Xiaoming is 21 years old to judge whether Xiaoming is suitable to serve as a soldier. The implementation code is as follows:
Expand knowledge:
Logical operators, which are used to combine the results of logical operations, are a group of very important operators in programming.
The logical operators in PHP are shown in the following table:
Logical operator example when the result is true & & or and (logical and) $m & & $n or $m and $n when both $m and $n are true, and either of $m and $n is false | | or or (logical OR) $m | | $n or $m or $n as long as either of $m and $n is true, the result is true xor (logical XOR) $m xor $n when $m and $n are true and the result is true! (logical not)! $m when $m is false The result is true.
After reading this, the article "what does php & & what does it mean" has been introduced. If you want to master the knowledge of this article, you still need to practice and use it yourself. If you want to know more about the article, please follow the industry information channel.
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.