PHP difference questions

Discussion in 'PHP' started by MarcL, Apr 8, 2007.

  1. #1
    What is the difference?


    require_once('file/file.php');

    include("file/file.php");
     
    MarcL, Apr 8, 2007 IP
  2. nextebizguy

    nextebizguy Peon

    Messages:
    276
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #2
    nextebizguy, Apr 8, 2007 IP
  3. srobona

    srobona Active Member

    Messages:
    577
    Likes Received:
    57
    Best Answers:
    0
    Trophy Points:
    88
    #3
    require_once('file/file.php');

    it means that 'file.php' will be included once in the page, and it must exist in the folder 'file', otherwise an error will be shown.


    include('file/file.php');

    It will only try to include the 'file.php' in a page, if the 'file.php' does not exist, no error will be shown.

    Hope it will help you understand the difference. :)
     
    srobona, Apr 8, 2007 IP