how i got the name of the string variable in the strange attempt to debug unknown variable ?
- by justjoe
i got several variable. One is variable string, object, and array.
$mystring = "hello im input";
$myobject = new userclass;
$myarray = array ( 0 = 'zero', 1 = "one");
i want to create a new array with its variable name as key before send it to as function parameter with it's first line use extract function. the multi_array will be like this
multi_array = array (
'mystring' = "hello im input",
'myobject' = new userclass,
'myarray' = array ( 0 = 'zero', 1 = "one")
)
i use key to get the name of array and getclass to get the name of object. But how i got the name of the string variable ?
function i_do_extract($multi_array) {
extract($multi_array);
// Do Rest
}