"easiest way to convert a php page to static html page" Code Answer


you can use output buffers. if you have an html page, such as:

        some text here

then if you put, at the top of the html file:

<?php ob_start(); ?>

and right at the bottom, after the last tag, put:

   $string = ob_get_contents(); 

   //do whatever you need to do to the html, save it to a seperate file, email it, etc


what this basically means is that the $string variable will end up with the entire static html of the page, after it has been dynamically generated. you can then use that string in an email. although really, html pages don't work exactly the same in emails, so you may want to rethink the approach.

By Tobias Nawa on May 29 2022

Answers related to “easiest way to convert a php page to static html page”

Only authorized users can answer the Search term. Please sign in first, or register a free account.