我有一个关于php heredoc的问题。我正试着做这样的事情。
$heredoc = <<<_HERE
This is the way
I try to use the
heredoc, but apparently
something is going wrong
_HERE;显然,我应该得到这个:
This is the way
I try to use the
heredoc, but apparently
something is going wrong但我得到的是:
这是我尝试使用heredoc的方式,但显然有些地方出了问题。
它没有格式化,其主要思想是获得格式化的文本。
有人能帮帮我吗?
发布于 2013-02-25 12:51:05
使用pre标签:
$heredoc = <<<_HERE
<pre>
This is the way
I try to use the
heredoc, but apparently
something is going wrong
</pre>
_HERE;发布于 2013-02-25 12:52:29
试一试
<?php
$heredoc = <<<_HERE
This is the way
I try to use the
heredoc, but apparently
something is going wrong
_HERE;
echo "<pre>";
echo $heredoc;
echo "</pre>";
?>https://stackoverflow.com/questions/15060306
复制相似问题