为了账号安全,请及时绑定邮箱和手机立即绑定

call_user_func(function($username){echo "hello {$username}";},'king);

call_user_func(function($username){echo "hello {$username}";},'king);


双引号 加粗的这块不明白什么意思 为什么这样表示 哪位大神帮忙解释一下 谢谢

正在回答

2 回答

就是把这部分输出,中括号里面代表的是一个变量

0 回复 有任何疑惑可以回复我~

call_user_func()方法是回调函数,

function($username){echo "hello {$username}";}

这部分是匿名函数,相当于function A($username){

echo "hello".$username;

}

"king"是要传递的参数,传给$username;相当于是A(‘King’);

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

call_user_func(function($username){echo "hello {$username}";},'king);

我要回答 关注问题
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号