RE: constant from variable

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

 



Use the constant() function:

echo constant( $my . $const );

http://www.php.net/manual/en/function.constant.php

-----Original Message-----
From: Tanel Tammik [mailto:keevitaja@xxxxxxxxx] 
Sent: Friday, June 04, 2010 3:08 PM
To: php-general@xxxxxxxxxxxxx
Subject:  constant from variable

Hi,

define('MYCONST', 'something');

$my = 'my';
$const = 'const';


is it possible to get the value of MYCONST using variables $my and
$const_

Br
Tanel 



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


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