Home > Backend Development > PHP Tutorial > Assignment Operator_PHP Tutorial

Assignment Operator_PHP Tutorial

WBOY
Release: 2016-07-13 17:26:26
Original
922 people have browsed it

The basic assignment operator is "=". You tend to think it means "equal to". Don't think of it this way, what it really means is that the operand on the left gets the value of the expression on the right.
The significance of an assignment expression lies in the assignment of values. In other words, the value of "$a=3" is 3. This allows you to do things like:

$a = ($b = 4) + 5;
// $a is equal to 9 now, and $b has been set to 4.
 
As a complement to the assignment operator, there is also a combination operator that operates on binary numbers and character strings. This operator allows you to use the value of the assigned expression on the assignment side. For example:
 
$a = 3;
$a += 5; // sets $a to 8, as if we had said: $a = $a + 5;
$b = "Hello ";
$b .= "There!"; // sets $b to "Hello There!", just like $b = $b . "There!";

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/531970.htmlTechArticleThe basic assignment operator is "=". You tend to think it means "equal to". Don't think of it this way, what it really means is that the operand on the left gets the expression on the right...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template