When I pass parameter to the function I know parameter value. How to get the actual name of the parameter?
function foo($a1) {
echo $a1; //value
}
foo($input);
In this case, how I can know that value that was passes has name 'input'
Thanks
When I pass parameter to the function I know parameter value. How to get the actual name of the parameter?
function foo($a1) {
echo $a1; //value
}
foo($input);
In this case, how I can know that value that was passes has name 'input'
Thanks
I'm pretty sure that the answer is: you can't.
You can't since input is not the actual name of the parameter. In fact variable namnes is only pointers to variables, the variable itself have no name. Input is the name of the pointer that you use outside the function, when you send the variable to the function it copies itself and get a new pointer named a1.