PHP中<<< EOD的用途是什么? [英] What is the use of <<<EOD in PHP?

查看:85
本文介绍了PHP中<<< EOD的用途是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用drupal和tcpdf实现PDF的节点.在这种情况下,我想使用此<<<EOD标记. 如果我不给出此o/p,则不完美.我不能完全理解<<<EOD的目的.

I am implementing node to PDF using drupal and tcpdf. In such case i am suppose to use this <<<EOD tag. If i didn't give this o/p is not perfect. I can't exactly get the purpose of <<<EOD.

有人可以解释一下这个概念吗?

Could anybody please explain the concept of this?

$html = <<<EOD
        <tr>
          <td>TEST</td>
        </tr>
EOD;

谢谢....

推荐答案

那不是HTML,而是PHP.它称为HEREDOC字符串方法,是使用引号编写多行字符串的替代方法.

That is not HTML, but PHP. It is called the HEREDOC string method, and is an alternative to using quotes for writing multiline strings.

您的示例中的HTML将是:

The HTML in your example will be:

    <tr>
      <td>TEST</td>
    </tr>

阅读 PHP文档对其进行说明.

这篇关于PHP中&lt;&lt;&lt; EOD的用途是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆