Home > php教程 > php手册 > php中的require-once,phprequire-once

php中的require-once,phprequire-once

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 08:55:39
Original
1232 people have browsed it

php中的require-once,phprequire-once

require_once语句和require语句完全相同,唯一区别是 PHP 会检查该文件是否已经被包含过,如果是则不会再次包含。

参见include_once的文档来理解_once的含义,并理解与没有_once时候有什么不同。

使用方法

  define('__ROOT__',dirname(dirname(__FILE__)));
  require_once(__ROOT__.'/config.php');
  ?>
  方法二:

2例如:编辑

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

require_once('sys/config.php');

require_once('header.php');

?>

 

系统平台

一个简单的留言板系统平台


一个简单的留言板。

 

require_once('footer.php');

?>

Related labels:
php
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template