<?php
$message="Hello";
$example=function () use(&$message){
echo $message;
};
$message="Hi";
$example();
$message="Hello";
$example=function () use(&$message){
echo $message;
};
$message="Hi";
$example();
2020-12-23
<?php
function factorial($num1){
$result=1;
for ($i=1;$i<=$num1;$i++){
$result*=$i;
}
$num1=5;
return $result;
}
$num1=3;
echo factorial($num1);
echo "\n";
echo '$num1:',$num1;
function factorial($num1){
$result=1;
for ($i=1;$i<=$num1;$i++){
$result*=$i;
}
$num1=5;
return $result;
}
$num1=3;
echo factorial($num1);
echo "\n";
echo '$num1:',$num1;
2020-12-23
最新回答 / weixin_慕标2337714
如果试用set_include_path导入的两个目录中有同名文件, 那么按照set_include_path顺序加载, 并且后面使用include也是只加载第一个
2019-12-19
<?php
$qq=123;
$aa=function($aa) use(&$qq)
{
echo $qq,"\n";
};
$qq=1234;
$aa(123);
$qq=123;
$aa=function($aa) use(&$qq)
{
echo $qq,"\n";
};
$qq=1234;
$aa(123);
2019-12-18