PHP PHP - output HTML file into variable 362 days ago Using the code you can get the contents of a HTML file and output them into a variable. <?php ob_start(); include "/filepath/file.php"; $html = ob_get_contents(); ob_end_clean(); Dylan Hoogeveen