这个PHP代码代表什么:'<<&书信电报;输入输入';?
我在Zend的网页上找到了这个代码这个PHP代码代表什么:'<<&书信电报;输入输入';?,php,string,Php,String,我在Zend的网页上找到了这个代码 <?php $input = <<<INPUT some text INPUT; ?> 好像是一样的 <?php $input = 'some text'; ?> 我以前从未见过,也找不到任何关于它的东西。有人能给我一个关键词吗 (请参阅:framework.zend.com/manual/current/en/modules/zend.escaper.escaping javascript.html) t
<?php
$input = <<<INPUT
some text
INPUT;
?>
好像是一样的
<?php
$input = 'some text';
?>
我以前从未见过,也找不到任何关于它的东西。有人能给我一个关键词吗
(请参阅:framework.zend.com/manual/current/en/modules/zend.escaper.escaping javascript.html)
ty这是简单的herdoc语法: 手册中的引文: 可以用四种不同的方式指定字符串文字:
- 单引号
- 双引号
- heredoc语法
- nowdoc语法(自PHP5.3.0起)
$input = <<<INPUT
some text
INPUT;
$input=使用三个than和一个标记用于多行字符串。多行字符串的结尾与开头选择的标记相同。在您的例子中,标签是“INPUT”。快速、快速、堆栈溢出。谢谢大家!顺便说一句,在您的示例中,结尾的herdoc文本缩进不正确。
$input = <<<'INPUT'
//^ ^ See here the difference
some text
INPUT;