At 16:56 01.03.2003, Daniel R. Hansen said: --------------------[snip]-------------------- >Can anyone tell me if it is possible (and how) to use defined constants >within "here document" content? I've not been successful finding anything >on this in the online docs. --------------------[snip]--------------------
You simply could have tried it - it's trivial. The answer: no, you cannot have a constant within a string, be it heredoc or quoted. A constant must always reside on "native code level". However you can easily concatenate strings and heredocs - both of the examples below work correctly: define('A_CONSTANT', 1); $text1 = <<<EOT This heredoc text contains the constant A_CONSTANT ( EOT . A_CONSTANT . <<< EOT ) outside the heredoc construct... EOT; $text2 = "This quoted text contains the constant A_CONSTANT (" . A_CONSTANT . ") outside the string quotes..."; echo "$text1<br />$text2"; Output: This heredoc text contains the constant A_CONSTANT (1) outside the heredoc construct... This quoted text contains the constant A_CONSTANT (1) outside the string quotes... -- >O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php