When to use this

Hi,can anyone enlighten my mind,when should i use the include_once and the required_once…and what is the difference on this two.Thank you in advance.

You would use them to include another file. A common example is to use include_once(‘header.php’) on each page, so you just have to maintain one header file (Makes it easier to add/remove links).

They both essentially do the same thing but if you use require, the file HAS to be available or you receive a fatal error whereas include_once will try to include it but if it can’t find it the page will still render.

http://stackoverflow.com/questions/3633900/difference-between-include-and-require-in-php

In practice, if you’re trying to include a file which doesn’t exist then you’re probably doing something wrong. In most cases, you’ll want to use Require.

@TomB @RichardAskew, .Thank you for the reply and i will write it again if i have in doubt.