string - $php = <<<xml 这种复制方式叫什么名字?有详细的介绍么?谢谢

WBOY
Release: 2016-06-06 20:52:45
Original
1175 people have browsed it

$sth = 
    

xml;
Copy after login
Copy after login

想问问这种写法对么?还有这种方式叫什么名字呢?
多谢各位!

回复内容:

$sth = 
    

xml;
Copy after login
Copy after login

想问问这种写法对么?还有这种方式叫什么名字呢?
多谢各位!

Heredoc结构
http://cn.php.net/manual/zh/language....

bash里头也有类似的写法,here document.

就是去读下面的字符,有啥读啥,像CDATA的样子。

HereDoc, 最近又出一个NowDoc 搜索吧。

这个叫定界符构建字符串
$sth =

xml;
就是这个字符串以 结束标记必须换行,顶格写。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template