ob_start();include('path/to/file/cms.php');display_footer();$myvar = ob_get_contents();ob_end_clean();