{"id":8876,"date":"2025-07-24T10:25:34","date_gmt":"2025-07-24T17:25:34","guid":{"rendered":"https:\/\/www.dognmonkey.com\/techs\/?p=8876"},"modified":"2025-07-24T10:25:34","modified_gmt":"2025-07-24T17:25:34","slug":"how-to-embed-html-in-php","status":"publish","type":"post","link":"https:\/\/www.dognmonkey.com\/techs\/how-to-embed-html-in-php.html","title":{"rendered":"How To Embed HTML In PHP"},"content":{"rendered":"<p><em>In WordPress blog, the website default to &#8220;index.php&#8221; and I want to load an htm file instead. Here&#8217;s how I did it.<\/em><\/p>\n<blockquote><p>&lt;?php<\/p>\n<p>$htmlContent = &lt;&lt;&lt;HTML<\/p>\n<p>&lt;!DOCTYPE html&gt;<br \/>\n&lt;html&gt;<br \/>\n&lt;head&gt;<\/p>\n<p>&lt;body&gt;<\/p>\n<p>&#8230;<\/p>\n<p>&lt;\/body&gt;<br \/>\n&lt;\/html&gt;<br \/>\nHTML;<br \/>\necho $htmlContent;<br \/>\n?&gt;<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/z_dognmonkey.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-8877\" src=\"https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/z_dognmonkey-300x192.jpg\" alt=\"html display from php\" width=\"300\" height=\"192\" srcset=\"https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/z_dognmonkey-300x192.jpg 300w, https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/z_dognmonkey.jpg 600w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a> <a href=\"https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/z_php_begin.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-8878\" src=\"https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/z_php_begin-300x249.jpg\" alt=\"php begins\" width=\"300\" height=\"249\" srcset=\"https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/z_php_begin-300x249.jpg 300w, https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/z_php_begin.jpg 600w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a> <a href=\"https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/z_php_end.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8879\" src=\"https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/z_php_end.jpg\" alt=\"php end\" width=\"583\" height=\"234\" srcset=\"https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/z_php_end.jpg 583w, https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/z_php_end-300x120.jpg 300w\" sizes=\"auto, (max-width: 583px) 100vw, 583px\" \/><\/a><br \/>\n<ul class=\"lcp_catlist\" id=\"lcp_instance_0\"><\/ul><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In WordPress blog, the website default to &#8220;index.php&#8221; and I want to load an htm file instead. Here&#8217;s how I did it. &lt;?php $htmlContent = &lt;&lt;&lt;HTML &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;body&gt; &#8230; &lt;\/body&gt; &lt;\/html&gt; HTML; echo $htmlContent; ?&gt; &nbsp;<\/p>\n","protected":false},"author":1,"featured_media":8877,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[1727,1320,1726],"class_list":["post-8876","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","tag-embed","tag-html","tag-php"],"views":29,"_links":{"self":[{"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/posts\/8876","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/comments?post=8876"}],"version-history":[{"count":1,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/posts\/8876\/revisions"}],"predecessor-version":[{"id":8880,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/posts\/8876\/revisions\/8880"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/media\/8877"}],"wp:attachment":[{"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/media?parent=8876"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/categories?post=8876"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/tags?post=8876"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}