In PHP:
- When should I use
requirevs.include? - When should I use
require_oncevs.include_once?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are
requireandinclude_onceas well.So your question should be…
requirevs.include?require_oncevs.requireThe answer to 1 is described here.
The answer to 2 can be found here.
Note that nowadays there is little use for *_once variants. If you are using them, it’s likely either a mindless habit or your code needs to be restructured.