关联参数传递的使用方法

 时间: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 暗夜猎手 薇恩 天赋符文出装加点攻略
  • 热门搜索
    陕西旅游出版社 微信如何修改密码 中秋节怎么放假 怎么能让皮肤变好 路由器无线桥接 武汉站在哪里 微山湖旅游攻略 柬埔寨在哪里 司马台长城旅游攻略 口臭严重了是身体哪里出问题了