Home > Backend Development > PHP Tutorial > php函数参数摘引调用

php函数参数摘引调用

WBOY
Release: 2016-06-13 10:55:55
Original
1224 people have browsed it

php函数参数引用调用
作者:zccst

一、参数的两种调用方式
1,传值调用

2,传址调用
function getFun(&$a){
    $a++;
}

$a = 1;
getFun($a);
echo $a; //$a的值是2.

批注:getFun不用返回值,因为函数直接修改了$a的数值。

二、数组和对象循环区别

php函数参数摘引调用

php函数参数摘引调用

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