I have a function defined like this: function test($var) { ... }
.
Inside this function, I want to determine if I passed a variable or a value to it when I called it, for example:
test('hello world')
should determine that I passed a string value.test($hello_world)
should determine that I passed a variable called$hello_world
This function just outputs the content that was passed and tells its data type, so, I currently get something like: String: "hello world"
but I am looking to get something like String ($hello_world): "hello world"
.
How can I check inside function test
in order to determine what was passed so that I change the output as required?