What is difference between include,require,include_once and require_once() ?

devquora
devquora

Posted On: Apr 15, 2024

 

    2 Answers Written

  •  devquora
    Answered by Ajay
    • Include and require both uses to include a PHP page within another PHP page in a project to initialize some predefined functions or programs. But the only difference between both is that if you have
      used include(test.php) and test.php does not exist then you would receive a warning error but
      execution would not interrupt while, if you have used require(test.php) and test.php does not
      exist then you would receive a fatal error and execution would be interrupted.
    • Same thing happens with include_once and require_once except that in that case file is required
      only once.
  •  devquora
    Answered by Kimpichindimngel@gmail.com

    I have been searching this type of web site finally I found it....it's so helpful and I do hope that one day i can crack the interview confidently thanks you so much ??

Related Questions

Please Login or Register to leave a response.

Related Questions

PHP Interview Questions

What is T_PAAMAYIM_NEKUDOTAYIM in PHP?

T_PAAMAYIM_NEKUDOTAYIM is scope resolution operator used as :: (double colon) .Basically, it used to call static methods/variables of a Class...

PHP Interview Questions

What is the difference between == and === operator in PHP ?

In PHP == is equal operator and returns TRUE if $a is equal to $b after type juggling and === is Identical operator and return TRUE if $a is equal to $b, and they are of the same data type...