PHP operators
I'll take a look at the arithmetic, string, logic, and comparison operators of PHP3, respectively.
1. Arithmetic operators
+: $a + $b plus $a plus $b-: $a-$b minus $a minus $b *: $a * $b multiply by $a multiplied by $b/: $a/$b divide $a by $b%: $a% $b modulo $a divided by $b remainder if two Count are integer values (strings will be converted to integer values), and division sign ("/") returns an integer value (divisible by value). If either operand is a floating-point value, do a floating-point division.
2 string operators
String operators have only string connectors ("."). $a = "Hello"; $b = $a. "World!"; Now $b = "Hello world!"
3. Assignment operators
The basic assignment operator is "=". The value of an assignment expression is the value assigned to it. For example, the value of the expression $a = 3 is 3. This allows you to do something complicated: $a = ($b = 4) + 5; Now $a equals 9, $b is 4. In addition to the basic assignment, there are "compound operators". For all binary numbers and strings, you are allowed to do variable self-compounding operations.
For example: =: $a = 3; + =: $a + = 5; Set $ A to 8, i.e. $a = $a + 5; $b = "Hello"; . : $b. = "there!"; Set $b as "Hello there!", just like $b = $b. "There!";
4, bitwise operators
Bit operations allow you to set or reset the specified data. &: With operations, $a & $b with $a and $b are set to the result is set |: or arithmetic, $a | $b or $a or $b has a set that results in a bit ~: Non-arithmetic, ~ $a non-$a not set the result is set
5. Logical operators
And: $a and $b with $a and $b are true if the result is true or: $a or $b or $a or $b have a true XOR: The result is true if the $a XOR $b different or $a and $b are true! : ! $a non-$a is false, the result is true &&: $a && $b true with $a and $b as true results | |: $a | | When a $b or $a or $b has a true result for a true comparison of two variables, there are two operators for the "and" and "or" operations, which means that two operators have different precedence 6, comparison operator comparison operators, which, like names, allow you to compare two values. = =: $a = = $b equals $a equals $b result is true! =: $a! = $b Not equal to $a not equal to $b result is true <: $a < $b less than $a less than the result is true >: $a > $b greater than $a greater than $b result True <=: $a <= $b less than or equal to $a less than or equals to $b result is true >=: $a >= $b greater than or equal to $a greater than or equal to $b result is true
http://www.bkjia.com/PHPjc/315724.html www.bkjia.com true http://www.bkjia.com/PHPjc/315724.html techarticle below the PHP operator, I'll look at the arithmetic, string, logic, and comparison operators of PHP3, respectively. 1, arithmetic operator +: $a + $b plus $a plus $b-: $a-$b minus $a minus $b *: ...