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
  • 497
  • 1
  • 7
  • 22

2 Answers2

6

You're talking about heredoc syntax. Example:

$str = <<<EOD
Example of string
spanning multiple lines
using heredoc syntax.
EOD;
karim79
  • 334,458
  • 66
  • 409
  • 405
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
  • 87,806
  • 20
  • 161
  • 152