Looking for somewhere to host your site? Browse our PHP web hosts section!

Home > Code Snippets > How to include a file in PHP

How to include a file in PHP

Description

If you have ever wondered how to include another PHP file into a PHP script, this simple one line code sample will show you how.

The code


<?php


// Place this into your PHP page
// and edit the file name
include "some_other_file.php";

?>

Get the code

Download the file to your computer: Click here to get the file