Home > Backend Development > PHP Tutorial > PHP value assignment and address assignment usage example analysis, assignment example analysis_PHP tutorial

PHP value assignment and address assignment usage example analysis, assignment example analysis_PHP tutorial

WBOY
Release: 2016-07-13 09:49:36
Original
889 people have browsed it

PHP value assignment and address assignment usage example analysis, assignment example analysis

This article describes the use of PHP value assignment and address assignment. Share it with everyone for your reference. The details are as follows:

<&#63;php
$name = 'Simon'; //对变量$name进行赋值(传值赋值)
$name_b = $name; //对变量$name_b进行赋值(传值赋值)
$addr = &$name; //对变量$addr进行赋值(传地址赋值)
$name = "Elaine"; //改变$name的值
echo $name; //输出$name,会发现$name的值发生了变化
echo $name_b; //输出$name_b,会发现$name_b的值没有发生变化
echo $addr; //输出$addr,会发现$addr的值发生了变化
$addr = "Helen"; //改变$addr的值
echo $name; //输出$name,会发现$name的值发生了变化
echo $addr; //输出$addr,会发现$addr的值发生了变化
&#63;>

Copy after login

I hope this article will be helpful to everyone’s PHP programming design.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1019435.htmlTechArticlephp value assignment and address assignment usage example analysis, assignment example analysis This article describes the php value assignment and Pass address assignment usage. Share it with everyone for your reference. The details are as follows:...
Related labels:
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