Re: constants in heredoc
- From: Jeff <dont_bug_me@xxxxxx>
- Date: Mon, 29 Dec 2008 22:38:59 -0500
Álvaro G. Vicario wrote:
Jeff escribió:How do I use a constant in a heredoc?
$sample = <<<sample_code
SOME_CONSTANT
sample_code;
echo $sample;
The constant in that case is just showing it's "name".
As far as I know you cannot. Heredoc is not as useful as it looks :)
Anyway, there's a user note that suggests a dirty trick:
http://es2.php.net/manual/en/language.types.string.php#74744
Thanks, the "dirty" trick is a bit of an understatement!
Jeff
.
- References:
- constants in heredoc
- From: Jeff
- Re: constants in heredoc
- From: "Álvaro G. Vicario"
- constants in heredoc
- Prev by Date: Re: ldap_bind issues
- Next by Date: Re: Smarty syntax for require?
- Previous by thread: Re: constants in heredoc
- Next by thread: Smarty syntax for require?
- Index(es):
Relevant Pages
|