how i got the name of the string variable in the strange attempt to debug unknown variable ?

Posted by justjoe on Stack Overflow See other posts from Stack Overflow or by justjoe
Published on 2010-04-09T20:29:16Z Indexed on 2010/04/09 20:33 UTC
Read the original article Hit count: 342

Filed under:
|
|

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
}

© Stack Overflow or respective owner

Related posts about php

Related posts about array