Home > Article > Backend Development > Detailed explanation of value assignment in php
Assignment is the most commonly used basic knowledge point in PHP development. Assignment in PHP is divided into passing valueassignment and referenceassignment. Let’s take a look at it below. Look at the concept of assignment by value
Assignment by value: assigning the value of the actual parameter to the row parameter, then modification of the row parameter will not affect the value of the actual parameter.
For example: the root copy is the same. For example, I have a house. I give you building materials. You build a house that is exactly the same as mine. Whatever you do in your house will not affect me. What I do in my house will not affect me. Nothing will affect you, independent of each other.
<table width="620" align="center" border="0" cellpadding="1" cellspacing="1" style="background:#FB7"> <tr> <td width="464" height="27" bgcolor="#FFE7CE"> 代码如下</td> <td width="109" align="center" bgcolor="#FFE7CE" style="cursor:pointer;" onclick="doCopy('copy8116')">复制代码</td> </tr> <tr> <td height="auto" colspan="2" valign="top" bgcolor="#FFFFFF" style="padding:10px;" class="copyclass" id=copy8116>$aa=1; $bb=2; $aa=$bb;//$aa和$bb互不相干 $aa=3; echo $aa,'--',$bb;//输出3--2 </td> </tr> </table>
The above is the detailed content of Detailed explanation of value assignment in php. For more information, please follow other related articles on the PHP Chinese website!