Home >Backend Development >PHP Tutorial >PHP function reference type parameters_PHP tutorial

PHP function reference type parameters_PHP tutorial

WBOY
WBOYOriginal
2016-07-12 09:06:17809browse

PHP function reference type parameters

$arr = array();
function add($flag,&$arr=array()){
$arr[$flag] = $flag;
$flag ;
if($flag < 5){
add($flag,$arr);
}
return;
}
add(0,$arr);
var_dump($arr);

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1065654.htmlTechArticlePHP function reference type parameter $arr = array(); function add($flag,$arr=array() ){ $arr[$flag] = $flag; $flag ; if($flag 5){ add($flag,$arr); } return; } add(0,$arr); var_dump($arr);. ..
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