Skip to content

Instantly share code, notes, and snippets.

@dcsg
Last active December 14, 2015 15:19
Show Gist options
  • Save dcsg/5106948 to your computer and use it in GitHub Desktop.
Save dcsg/5106948 to your computer and use it in GitHub Desktop.
Get HTML contents into a PHP file and print it.
<?php
//will output the content of the file and Parse anything inside <?php ?> tags
include 'example-2.php';
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
example
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
example
</body>
</html>
<?php
$html = file_get_contents('example.html');
echo $html;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment