Re: Using a variable to call another variable

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

 



On Sat, 09 Sep 2006 08:55:35 -0500, Christopher Weldon <cweldon@xxxxxxxxxxxxxxxxxx> wrote:
> 
> class myClass {
> 	private var $_001;
> 	private var $_002;
> 	private var $_003;
> 
> 	public function access_var($var) {
> 		return $this->$$var;
> 	}
> }
> 
> $cs = new myClass;
> $cs->access_var('_001');

How about call a function whose name is returned from the function myFunc()? :-D

Ansewer:

{myFunc()}()

My 2 cents.

--
---------------------------------------------------------
Lic. Martín Marqués         |   SELECT 'mmarques' || 
Centro de Telemática        |       '@' || 'unl.edu.ar';
Universidad Nacional        |   DBA, Programador, 
    del Litoral             |   Administrador
---------------------------------------------------------

-- 
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