How do you use define within a heredoc? For example:
define('PREFIX', '/holiday'); $body = <<<EOD <img src="PREFIX/images/hello.png" /> // This doesn't work. EOD;
taken from the documentation regarding strings
DEFINE('PREFIX','/holiday'); $const = PREFIX; echo <<<EOD <img src="{$const}/images/hello.png" /> EOD;
2.1m questions
2.1m answers
60 comments
57.0k users