Possible Duplicate:
How to get a variable name as a string in PHP?
I'm needding something similar to the code below:
code
<?php
$var1='my var 1';
$array1['1']='first position of my array 1';
$array1['2']='second position of my array 1';
echo name($var1);
echo "<br>";
echo name($array1);
function name($parameter){
...?...
}
?>
screen return
var1
array1
So, I need to write a function that gives me the name of a variable or an array that I pass to it. How can I perform this?
I will use this function on another function to perform some tasks to me...