php heredoc
snippet in php

php heredoc

user8793

	$output = <<<HTML
	<p>Lorem ipsum dolor sit amet consectetur<p>
	<a href="{$foobar}">click here</a>
HTML;

heredoc php

user5157

$str = <<<MYTEXT
This is a
demo message
with heredoc.
MYTEXT;
 
echo $str;

heredoc php

user290

$name = 'name';

$str =  <<<EOT
 my name is $name 
 line 2
 line 3
 
 " you can put double quote
 
 ' you can put simple quote
 
 few lines
 
EOT; // take it at the beginning of the line

echo $str;