关联参数传递的使用方法

 时间:2026-02-18 15:14:01

1、方法一:


functionfoo(&$bar){
$bar.="andsomethingextra";
}
$str="ThisisaString,";
foo($str);
echo$str;//output:ThisisaString,andsomethingextra

echo"<br>";

关联参数传递的使用方法

2、方法二:


functionfoo1($bar){
$bar.="andsomethingextra";
}
$str="ThisisaString,";

foo1($str);


echo$str;//output:ThisisaString,

echo"<br>";

foo1(&$str);


echo$str;//output:ThisisaString,andsomethingextra
?>

  • 户外旅游遇险正确发送求救信号的基本要领
  • 10oa主动提醒功能,有哪几种提醒方式?
  • 台湾亲子游自由行攻略
  • 肉汁萝卜的做法
  • lol s8 VN 暗夜猎手 薇恩 天赋符文出装加点攻略
  • 热门搜索
    exp什么意思 随迁子女是什么意思 9月20日是什么星座 怜悯的近义词是什么 什么是高血压 信仰是什么 dnf搬砖是什么意思 息税前利润是什么意思 燕窝是什么 5月28日是什么星座