How can HTML code be passed as a variable in PHP without escaping characters?

When passing HTML code as a variable in PHP without escaping characters, you can use the "heredoc" syntax. This allows you to define a block of text without the need to escape special characters. By using heredoc syntax, you can easily assign HTML code to a variable without worrying about escaping characters.

$html = <<<HTML
<html>
<head>
<title>Sample Page</title>
</head>
<body>
<p>This is a sample HTML code stored in a variable.</p>
</body>
</html>
HTML;

echo $html;