PHP is still more commonly used, so I studied the PHP logical operators, here to share with you, I hope to be useful to everyone. PHP is a powerful server-side scripting language for creating dynamic, interactive sites.
PHP is free and very widely used. At the same time, for competitors such as Microsoft ASP, PHP is undoubtedly another high-efficiency option. PHP is great for web development, and its code can embed HTML code directly. PHP syntax is very similar to Perl and C. PHP is often used in conjunction with Apache (Web server). However, it also supports ISAPI and can run on Windows's Microsoft IIS platform. The string operator, which has two string operators. The first one is the join operator (".") ), which returns the string after its left and right arguments are concatenated. The second is the Join assignment operator (". ="), which attaches the right argument to the left argument.
1. String operators
Example:
- Php
- $ a = "Hello" ;
- $ b = $a. " world! ";
- $ a = "Hello" ;
- $ A. = "world!" ;
- ?>
The only one array operator in PHP is the + operator. It appends the right array to the left array, but the duplicate key values are not overwritten.
- $ a = Array ("A" =>"Apple", "b" =>"banana");
- $ b = Array ("A" =>"pear", "b" =>"Strawberry", "c" => "Cherry");
- $ C = $a + $b;
Once executed, this script will display:
- Array (3) {
- ["A"]= >
- String (5) "Apple"
- ["B"]= >
- String (6) "Banana"
- ["C"]= >
- String (6) "Cherry"
2.PHP logical operators :
PHP logical operators:
$aand $band (logical AND) true if $ A and $b are both true.
$aor $bor (logical OR) True if either $ A or $b is true.
$axor $bxor (Logical XOR) True if either $ A or $b is true, but not both.
! $aNot (logical non) True if $ A is not true.
$a && $bAnd (logical AND) true if $ A and $b are true.
$a | | $bOr (logical OR) True if either $ A or $b is true.
There are two different form operators for "and" and "or" because their operations have different precedence.
http://www.bkjia.com/PHPjc/446483.html www.bkjia.com true http://www.bkjia.com/PHPjc/446483.html techarticle PHP is still more commonly used, so I studied the PHP logical operators, here to share with you, I hope to be useful to everyone. PHP is a powerful way to create dynamic interactive sites ...