1//use EOD function for multiple line variable
2$variable=<<<EOD
3 this is line1
4 this is line2
5 EOD;
6
1phpCopy<?php
2$mystring1 = "This is the first line." . PHP_EOL;
3$mystring2 = "This is the second line" . PHP_EOL;
4$mystring3 = "This is the third line" . PHP_EOL;
5$mystring4 = "This is the fourth line" . PHP_EOL;
6$mystring5 = "This is the fifth line";
7$mystring1 .= $mystring2 .= $mystring3 .= $mystring4 .= $mystring5;
8echo($mystring1);
9?>
10
1phpCopy<?php
2$mystring1 = "This is the first line." . PHP_EOL;
3$mystring2 = "This is the second line";
4$mystring1 .= $mystring2;
5echo($mystring1);
6?>
7