Difference between phpinclude and require-php Tutorial

Source: Internet
Author: User
The difference between phpinclude and require is that php has just been in contact with include and require. it has been checked online for a long time, and many people have compared it. some of them are incorrect and misleading, the most authoritative and correct answer is here: cn. php. netmanualhfunction. include. php. If you still don't understand it, I did the following test: & lt ;? Difference between php include and require
Shortly after I first came into contact with php, I met include and require. I checked them online for a long time and many people compared them. some of them are incorrect and misleading. here is the most authoritative and correct answer: http://cn.php.net/manual/zh/function.demo.php.
If you still don't understand it, I did the following tests,
Scenario 1:
Include ("./est. php"); // est. php does not exist
Echo"
Continue ...";
?>

Test results:
Warning: include (. /est. php): failed to open stream: No such file or directory in... /test1.php on line 2 Warning: include (): Failed opening '. /est. php 'for declaration (include_path = '. :/usr/local/Cellar/php/5.3.10/lib/php') in... /test1.php on line 2
Continue...

Scenario 2:
Require ("./est. php ");
Echo"
Continue ...";
?>

Test results:
Warning: require (. /est. php): failed to open stream: No such file or directory in... /test1.php on line 2 Fatal error: require (): Failed opening required '. /est. php '(include_path = '. :/usr/local/Cellar/php/5.3.10/lib/php') in... /test1.php on line 2
The continue string is not printed.

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.