At MFD we are all for saving time and making life easier, even when it comes to the geeky stuff such as PHP programming (yeah, we know, contain yourselves!). Creating and calling in PHP files into a webpage is a great way of keeping coding separate and allowing for easy site wide updating. Instead of having to edit the code on every page each time you make a change, by editing the PHP file all pages including the called in code will automatically update.
By making use of the PHP include function it is possible to place any PHP code where you need it in any specific file. If, for example, you had a PHP file call ‘FROGGY.php’, you could include it using the following line of code:
<?php include ‘FROGGY.php’ ;?>
This would call in the FROGGY.php file wherever the code has been placed and only the PHP file FROGGY has to be edited to make site wide changes.
The frogs here at MFD like to build websites with the popular WordPress platform* and using this method saves us a lot time as it is primarily PHP based.
*Other popular web building platforms are also available