Re: constants in heredoc
- From: "Álvaro G. Vicario" <alvaroNOSPAMTHANKS@xxxxxxxxxxxxxx>
- Date: Mon, 29 Dec 2008 18:20:08 +0100
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
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor al baño María: http://www.demogracia.com
--
.
- Follow-Ups:
- Re: constants in heredoc
- From: Jeff
- Re: constants in heredoc
- References:
- constants in heredoc
- From: Jeff
- constants in heredoc
- Prev by Date: constants in heredoc
- Next by Date: Re: Strings, arrays and efficiency
- Previous by thread: constants in heredoc
- Next by thread: Re: constants in heredoc
- Index(es):
Relevant Pages
|