PHP include、include_once,require、require_once的区别
大家都知道include和require都有个_once,但是烦我一开始并不知道有什么用(php手册的看不明白)于是,就研究出来了
举个栗子:
1.php
<?php include('A.php'); include('B.php'); include('C.php'); ?>
B.php
<?php include('C.php'); ?>
这样的话a.php就会出错
如果我们把1.php中的
include('B.php');
改成
include_once('A.php');
就可以了。
require同理
程序猿与死宅男的结合体.