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

php函数参数摘引调用

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 10:55:551256browse

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

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

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

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

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

二、数组和对象循环区别

php函数参数摘引调用

php函数参数摘引调用

Statement:
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