PHP provides a method of constructing a multi-line string sequence using the <<< operator, usually called a here-document or expressed as the abbreviation of heredoc.
This method elaborates the literal value of the string and preserves the string's underscores and other whitespace (including indentation) in the text. For example:
<span>1</span> <?<span>php </span><span>2</span><span>$author</span> ='wixy'<span>; </span><span>3</span><span>echo</span> <<<<span>_END </span><span>4</span><span>Thisis a Headline </span><span>5</span> Thisis the first line. <span>6</span> Thisis the second line. <span>7</span> ---Writtenby <span>$author</span>. <span>8</span><span>_END; </span><span>9</span> ?></p> <p>The PHP parser will output all the content between the two _END tags, which is equivalent to a string quoted with double quotes. </p> <p>This means that we can write an entire HTML language directly in PHP code, and then use PHP variables to replace the specific dynamic parts. </p> <p></p> <p></p> <ol><li> <p></p> <pre class="brush:php;toolbar:false"><span>1</span> <?<span>php </span><span>2</span><span>$out</span> =<<<<span>_END </span><span>3</span> ..... <span>4</span><span>_END; </span><span>5</span> ?>
You can also use the above method to assign the contents of the two tags to variables.
Note: The _END tag used to close must be placed on a separate line, and no other content can be added to this line, even comments or spaces are not allowed
The above introduces in PHP