Variable in variable.

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

 



I know that in PHP I can use this:

$var1 = "text";
$var2 = '$var1';
4cho $$var2;

So it gives me "text".

My question is, is there a way of doing it with constant like this?

define("CONST", "text");
$test = "CONST";
echo $$test;

So it gives me "text".

Thanks in advance.
-- 
João Cândido de Souza Neto



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