Forum Moderators: coopster
Imagine a function
foo($x);
You can call it as
foo('hallo');
or as
foo($text);
or as
foo($text1.$text2);
Can foo() find out how it has been called? Whether its argument was "'hallo'" or "$text" or "$text1.$text2"?
Or at least what the name of the variable was ("$text")?
There is nothing written about that in the PHP docs in the topics about
* magic constants (like "__FUNCTION__")
* func_get_args()
* Variable-length argument lists
* variable references
* debug_backtrace()
ANY help is greatly appreciated!
if I call the function using: function("blah") to return
"blah" $foo.$bar "blah $bleh", $var That kind of stuff ...
I think func_get_args [php.net] is what you want. Especially look at the user contributed examples.