multiline variable string php code example
Example 1: php multiple line string
//use EOD function for multiple line variable
$variable=<<<EOD
this is line1
this is line2
EOD;
Example 2: Write Multi-Line Strings in PHP
phpCopy<?php
$mystring1 = "This is the first line." . PHP_EOL;
$mystring2 = "This is the second line";
$mystring1 .= $mystring2;
echo($mystring1);
?>