Last active
April 14, 2021 07:22
-
-
Save minte9/9d455965563c4234371f2c627aa94a3c to your computer and use it in GitHub Desktop.
Php / Basics / Quotes - https://www.minte9.com/php/basics-quotes-14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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