0

Example of using INCLUDE to show a nav bar. For beginners. Simply uses include to show an external file (in this case, nav.php) and that's it! You can also include this in another page with a CSS style. The CSS will be automatically included in formatting the INCLUDEd page! :D

<?php
include("navigation.php");
?>
2
Contributors
1
Reply
2
Views
12 Years
Discussion Span
Last Post by Dani
0

If you're goal is to deal with output, you may find that using ob_ is more flexible, as it lets you retrieve the output from external files and store them in variables for later use.

The syntax would be:

<?php
ob_start();
$output = ob_get_contents();
ob_end_clean();
?>

There are also a whole bunch of other ob_ functions. Check the php.net manual for more information.

Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.