Skip to content

Instantly share code, notes, and snippets.

@slav123
Created May 7, 2015 02:37
Show Gist options
  • Save slav123/8474018450c638ca76b7 to your computer and use it in GitHub Desktop.
Save slav123/8474018450c638ca76b7 to your computer and use it in GitHub Desktop.
long code in PHP
<?php
$var = "some text";
$text = <<<EOT
Place your text between the EOT. It's
the delimiter that ends the text
of your multiline string.
$var
EOT;
// The difference between Heredoc and Nowdoc is, that php code embedded in an heredoc gets executed, while php code in Nowdoc will be printed out as is.
$var = "foo";
$text = <<<'EOT'
My $var
EOT;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment