include.php

<?php
  include('functions.inc.php');  // slurp library of shared functions
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <title>File inclusion example</title>
    <meta charset="utf-8">
  </head>
  <body>
    <?php
    include('header.inc.html');	// grab the boilerplate header

    $x = 3;				// original value of x
    print "x = $x<br />";		// print it to see
    print "2x=" . twice($x) . "<br />"; // print 2x but leave x unchanged
    print "x = $x<br />";		 // show that x is unchanged
    double($x);				 // now double x for real
    print "x = $x<br />";		 // show that x is doubled
    ?>
  </body>
</html>