How To Include A File In PHP
Computing : Learning PHP One of the best things about languages like PHP is the easy ability to include code across several files. Thus if you have a top or left hand menu you can define it once likes a template and then simply include across the site. This then makes it really easy to change should you need to across the site. Simply place the code to be included in a file and if it contains PHP ensure that you have the PHP code markers at the start and end of the file. Then to include simply add this to the file that includes it: include ("myinclude.php"); Note that if you want to be sure that you don't include the same file more than once, then just use: include_once("myinclude.php"); if already included subsequent files will realise this and ignore the additional calls to include that file.
Questions about PHP and mySQL:
|
|