note 26588 added to language.constants
| From: | gv at rack1 dot php dot net | Date: | Wed, 06 Nov 2002 02:08:50 +0000 |
| Subject: | note 26588 added to language.constants | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-39016@lists.php.net to get a copy of this message | ||
fmmarzoa: In PHP 4.2.2/CLI, I had no problem setting define()'s to the contents of variables:
<?
$foo = "PHP";
define( "bar", "$foo is a good thing." );
print bar;
?>
Will print "PHP is a good thing.".
A notable difference, however, between my example and yours is your use of single-quotes. Strings
in single quotes (') will not be expanded:
print '$foo';
Will print '$foo', not the contents of $foo.
http://www.php.net/manual/en/language.types.string.php
--gv
--
http://www.php.net/manual/en/language.constants.php
http://master.php.net/manage/user-notes.php?action=edit+26588
http://master.php.net/manage/user-notes.php?action=delete+26588
http://master.php.net/manage/user-notes.php?action=reject+26588