php传值赋值和传地址赋值用法实例分析,赋值实例分析
本文实例讲述了php传值赋值和传地址赋值用法。分享给大家供大家参考。具体如下:
<?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的值发生了变化 ?>
希望本文所述对大家的php程序设计有所帮助。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 Chinese version
Chinese version, very easy to use

Notepad++7.3.1
Easy-to-use and free code editor

Dreamweaver Mac version
Visual web development tools
