Including Other Files : include « Utility Function « PHP
- PHP
- Utility Function
- include
Including Other Files
//foo.php:
<?php
print "Starting foo\n";
include 'bar.php';
print "Finishing foo\n";
?>
//bar.php:
<?php
print "In bar\n";
?>
After including foo.php would look like this:
<?php
print "Starting foo\n";
print "In bar\n";
print "Finishing foo\n";
?>
Related examples in the same category