In fact, PHP contains the four functions of files, which many people still don't fully understand. although many functions are used, but how to use them in some specific places, I will be ugly. include_once is similar to require_once. it is used to check whether the contained file has been included. if so, it will not be executed. Otherwise, it will be included again. the reason for this is that if you have clarified include and require. that's okay.
The difference between include and require:
The content contained in the require () function is considered as an integral part of the current file. Therefore, when the contained file has a syntax error or the file does not exist, the PHP scripts of the current file are not executed.
The include () function is equivalent to specifying the path of the file. when the file to be included has errors, the program running will not be affected.
The include function can be used to determine whether the include function is included or not, while require is included in all situations. Therefore, it is worth noting that!
We recommend that you include dynamic files, that is, variables, functions, and classes. however, some people have been analyzing the execution efficiency of the two functions some time ago. I did not test this by myself. I will try it again later.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service