How can Heredoc syntax be utilized in PHP for defining strings?

Heredoc syntax in PHP allows for the definition of multi-line strings without the need for escaping characters. To use Heredoc syntax, simply enclose the string in <<<EOD and end it with EOD; on a new line. This can be useful for defining large blocks of text or HTML code within PHP scripts.

$myString = &lt;&lt;&lt;EOD
This is a multi-line string
that can contain variables like $variable
and special characters without the need for escaping.
EOD;

echo $myString;