请解释一下这个PHP代码 “<<< CSS”
问题描述:
可能重复:
Reference - What does this symbol mean in PHP?
What is the name for the “<<<” operator?请解释一下这个PHP代码 “<<< CSS”
我可以推断这是什么做什么,但我需要知道怎么了,可能会找到一些文档。 标题<<<CSS
中的表达式似乎设置了一个要插入模板的css块。但是,没有功能可以从这些文本字符串中去除<<<CSS
,但它们不会出现。这使我相信<<<
不只是一个随机标记,但具有特殊的PHP含义。请帮忙。
if(!empty($background['header_image'])){
$header_image = <<<CSS
background-image: url('{$background['header_image']}');
background-repeat: {$background['header_repeat']};
background-position: top {$background['header_position_x']};
background-attachment: scroll;
CSS;`
答
它被称为定界符:http://www.tuxradar.com/practicalphp/2/6/3
基本上,它说:“插入此字符串后一切< < < CSS,直到您找到自己在一行CSS。”
+0
谢谢,非常有帮助的链接了。 – DogBot 2012-02-02 22:09:51
我试过在google和这个论坛中搜索'“ DogBot 2012-02-02 22:08:22