传递给函数的原始变量名? [英] original variable name passed to function?
本文介绍了传递给函数的原始变量名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能的重复:
PHP:获取作为参数传递的变量名称
如何在PHP?
如果我有
$abc = '123';
function write($var){
}
我如何在 write
中发现现在由 $var
表示的变量被称为 $abc
?
How would I inside write
find out that the variable now represented by $var
was called $abc
?
推荐答案
这是不可能的.即使传递引用也无济于事.您必须将名称作为第二个参数传递.
It's not possible. Even pass-by-reference won't help you. You'll have to pass the name as a second argument.
但是您所问的问题绝对不能很好地解决您的问题.
But what you have asked is most assuredly not a good solution to your problem.
这篇关于传递给函数的原始变量名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文