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;
1.4m articles
1.4m replys
5 comments
57.0k users