我在Zend的页面上找到了这段代码......
<?php
$input = <<<INPUT
some text
INPUT;
?>
Run Code Online (Sandbox Code Playgroud)
好像是......
<?php
$input = 'some text';
?>
Run Code Online (Sandbox Code Playgroud)
我以前从未见过它,也找不到任何关于它的东西.有人可以给我一个关键字吗?
(参见:framework.zend.com/manual/current/en/modules/zend.escaper.escaping-javascript.html)
TY
这是简单的heredoc语法:http://php.net/manual/en/language.types.string.php
手册中的引用:
字符串文字可以用四种不同的方式指定:
heredoc就像你拥有它一样:
$input = <<<INPUT
some text
INPUT;
Run Code Online (Sandbox Code Playgroud)
和nowdoc非常相似:
$input = <<<'INPUT'
//^ ^ See here the difference
some text
INPUT;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
69 次 |
| 最近记录: |