includ和require都是把其他页面加载当前页面,不过不同的是,require如果没有找到,或者所包含的页面里面有错误就不会往下执行了
<?php include 'form.php'; require 'aasdfa.php'; ?>
form.php 存在所以没有问题
aasdfa.php没有所以报错了
Warning: require(aasdfa.php): failed to open stream: No such file or directory in D:phpStudyWWWlearninclud_require.php on line 4
Fatal error: require(): Failed opening required 'aasdfa.php' (include_path='.;C:phppear') in D:phpStudyWWWlearninclud_require.php on line 4