Skip to content

Instantly share code, notes, and snippets.

@minte9
Last active April 14, 2021 07:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save minte9/9d455965563c4234371f2c627aa94a3c to your computer and use it in GitHub Desktop.
Save minte9/9d455965563c4234371f2c627aa94a3c to your computer and use it in GitHub Desktop.
<?php
/**
* Define $output on multiple $lines
* Use Herodoc syntax.
*
* output =
* She said "This is John's test"
* on multiple rows
*/
/**
* SOLUTION
*/
$who = "John";
$output = <<<TEST
She said "This is $who's test"
on multiple rows
TEST;
echo nl2br($output);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment