Re: Get recursive array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux