php include require

Posted 宝清老窖

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php include require相关的知识,希望对你有一定的参考价值。

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:\phpStudy\WWW\learn\includ_require.php on line 4

Fatal error: require(): Failed opening required ‘aasdfa.php‘ (include_path=‘.;C:\php\pear‘) in D:\phpStudy\WWW\learn\includ_require.php on line 4








以上是关于php include require的主要内容,如果未能解决你的问题,请参考以下文章

php require include

PHP中include和require的区别详解

php中include()和require()的区别

PHP include 与 require 区别

「PHP」include()include_once()require()require_once()的用法及区别

PHP中require和include的区别