Google

Monday, November 19, 2007

The Include Function in PHP5

The include function takes a file name and simply inserts that file's contents into the script that calls used the include function.

Well, first of all, this means that you can type up a common header or menu file that you want all your web pages to include. When you add a new page to your site, instead of having to update the links on several web pages, you can simply change the Menu file.

 include('header.php');

The include command simply takes all the text that exists in the specified file and copies
it into the file that uses the include function. Include is quite useful when you want
to include the same PHP, HTML, or text segment on multiple pages of a website. The include
function is used widely by PHP web developers.



No comments: