1

i remember a while ago i used a method like this to print out content so i didnt have to use slashes every time i had to use a quotation.

>> 

some text here "and more text



something;

what was that called? and how did it look

thanks

this im gonna write down :p

SarmenHB
  • 505
  • 1
  • 7
  • 23

2 Answers2

6

You're talking about heredoc syntax. Example:

$str = <<<EOD
Example of string
spanning multiple lines
using heredoc syntax.
EOD;
karim79
  • 339,989
  • 67
  • 413
  • 406
0

That's PHP Heredocs. There's an example on the manual page:

<?php
class foo {
    public $bar = <<<EOT
bar
EOT;
}
?>

The heredoc starts with <<< folowed by an identifier, and ends with that same identifier followed by a semicolon. Note that the end identifier must start at the beginning of a line, and cannot be indented.

Daniel Vandersluis
  • 91,582
  • 23
  • 169
  • 153