How To Embed HTML In PHP

In WordPress blog, the website default to “index.php” and I want to load an htm file instead. Here’s how I did it.

<?php

$htmlContent = <<<HTML

<!DOCTYPE html>
<html>
<head>

<body>

</body>
</html>
HTML;
echo $htmlContent;
?>

 

html display from php php begins php end

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.