Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/245.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
这个PHP代码代表什么:'<<&书信电报;输入输入';?_Php_String - Fatal编程技术网

这个PHP代码代表什么:'<<&书信电报;输入输入';?

这个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

我在Zend的网页上找到了这个代码

<?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;