Is there a standard for Require, Include in PHP?

Asked

Viewed 16 times

0

Hello, hello initiating in PHP and working on some projects at the same time, so I’m learning and solving at the same time, I realized that I end up using many includes and includes_once eventually ends up occurring problems, something that with the understanding about the difference between them I could decrease, however I wonder if there’s a pattern?

'Cause I had an idea that would be the creation of a header with several functions and within those functions would include, requires with the pages necessary for the functioning of the current page.

Sure trying to leave these functions the most widespread possible, so I could use a function for several pages.

  • The difference between include and require is how an error is treated. require produces an error E_COMPILE_ERROR , which terminates script execution. O include only produces a warning which can be "stuffy" with @

  • My question was not this friend, I put it in bold, they even closed my question, but she is not that, I do not want to know what it is for and their differences and yes there is some smart way or a pattern to be used, so I spoke in the creation of a Header, putting them into functions for and giving require only in the function file and using the best function for the current page/script. Thank you for the answer but that is not my question.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.