0

Possible Duplicate:
Reference - What does this symbol mean in PHP?
What is the name for the “<<<” operator?

I can infer what this is doing but I need to know how, and possible find some documentation. The expression in the title <<<CSS seems to set up a block of css to be inserted into a template. However there are no functions to strip the <<<CSS from these text strings yet they do not appear. This leads me to believe that <<< is not just a random marker but has special PHP meaning. Please help.

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;`
Community
  • 1
  • 1
DogBot
  • 528
  • 1
  • 6
  • 15
  • I tried searching for '“<<<” operator' both in google and this forum. Try yourself. I tried "3 less-than" etc. etc. etc.. I really tried before posting. – DogBot Feb 02 '12 at 22:08

2 Answers2

3

That's called heredoc. See the PHP documentation.

It's an easy way to assign multiple lines of text to a variable.

Ryan
  • 26,884
  • 9
  • 56
  • 83
2

It's called a heredoc: http://www.tuxradar.com/practicalphp/2/6/3

Basically, it says "insert into this string everything after <<<CSS until you find CSS on a line by itself."

kitti
  • 14,663
  • 31
  • 49