Php Include And Require Commands

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • priya.sharma
    Senior Member
    • Aug 2016
    • 105

    Php Include And Require Commands

    What Is The Difference Between Include And Require Commands In Php?
  • priya.sharma
    Senior Member
    • Aug 2016
    • 105

    #2
    The key difference between require() and include() is that if you require() a file that can't be loaded (eg if it isn't there) then it generates a fatal error which will halt the execution of the page completely, and no more output will be generated.

    Comment

    • Swati walia
      Senior Member
      • Sep 2016
      • 108

      #3
      require will produce a fatal error and stop the script
      include will only produce a warning and the script will continue

      Comment

      • Guest

        #4
        Both are used to include a file in other file but there is a little bit difference in the case of include if the file doesn't exist it will shoot a warning while in require case it will give you a fatal error.

        Comment

        • Swati walia
          Senior Member
          • Sep 2016
          • 108

          #5
          Thanks for sharing

          Comment

          Working...