SyntaxFix
Write A Post
Hire A Developer
Questions
Tags
I use PHP's EOF string to format HTML content without the hassle of having to escape quotes etc. How can I use the function inside this string?
<?php $str = <<<EOF <p>Hello</p> <p><?= _("World"); ?></p> EOF; echo $str; ?>
This question is related to php gettext eof
php
gettext
eof
As far as I can see, you just added heredoc by mistake No need to use ugly heredoc syntax here. Just remove it and everything will work:
<p>Hello</p> <p><?= _("World"); ?></p>
Source: Stackoverflow.com