PHP include() Function

You can insert the content of one PHP file into another PHP file before the server executes it, with the include() or require() function.
The two functions are identical in every way, except how they handle errors:

include() generates a warning, but the script will continue execution
require() generates a fatal error, and the script will stop

These two functions are used to create functions, headers, footers, or elements that will be reused on multiple pages.
Server side includes saves a lot of work. This means that you can create a standard header, footer, or menu file for all your web pages. When the header needs to be updated, you can only update the include file, or when you add a new page to your site, you can simply change the menu file (instead of updating the links on all your web pages).

views : ( 722 )

Share This :  

 

Login To Post Your Feedback

Username  :

ex : johnpeter
Password  :

password must have min 6 chars
     

  Subscribe to get alerts on scripts of this category
Email Id
Category