Re: Get recursive array

From: Date: Mon, 06 Feb 2006 17:17:05 +0000
Subject: Re: Get recursive array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-229973@lists.php.net to get a copy of this message
Hi Jochem, well, thanks for the code... it's working perfect, but it seams a little bit slow as it's using while... doesn't? Now, abusing of you, how can I unset a variable the same recursive way? :D Maybe like this? /*********************************************************************** * @function_name get_var * @function_type Method * @function_input None * @function_description None ***********************************************************************/ function get_var() { $arguments = func_get_args(); if(empty($arguments)) { return null; } $reference =& $this->vars; while($argument = array_shift($arguments)) { if(!isset($reference[$argument])) { return null; } else { $reference =& $reference[$argument]; } } unset($reference); } And I didn't double posted, I had to subscribe... and I didn't know if my message had been sent or not. Thanks, Bruno B B Magalhaes

« previous php.general (#229973) next »