Skip to content

Instantly share code, notes, and snippets.

@minte9

minte9/index.php

Last active Apr 14, 2021
Embed
What would you like to do?
<?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