Include and Require are both used to include a file into a php script. The main difference between them is that when a file is included with the include statement and PHP cannot find it, the script will continue to execute:

Example:

However, when a file is included with the require statement and PHP cannot find it, the script will stop executing:

Example:

Leave a Reply

Your email address will not be published. Required fields are marked *