zoukankan      html  css  js  c++  java
  • php中的require-once

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

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

    使用方法

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

    <?phprequire_once('/var/www/public_html/config.php');?>

    2例如:编辑

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    11

    12

    13

    14

    15

    16

    17

    18

    19

    <?php

    require_once('sys/config.php');

    require_once('header.php');

    ?>

    <divclass="row">

    <divclass="ddos"style="text-align:center;">

    <h1><b>系统平台</b></h1>

    <p>一个简单的留言板系统平台</p><br/>

    </div>

    <divclass="xx_xx">

    <h2>一个简单的留言板。</h2>

    <p></p>

    </div>

    </div>

    <?php

    require_once('footer.php');

    ?>

  • 相关阅读:
    openmp
    opencv 读写矩阵
    string to const char*
    c++ string to number
    HDU 1520 Anniversary Party
    ZOJ 1003 Crashing Balloon
    HDU 4171 Paper Route
    ZOJ 2067 White Rectangles
    TOJ 1690 Cow Sorting (置换群)
    TOJ 2814 Light Bulb
  • 原文地址:https://www.cnblogs.com/xiaolongphp/p/4767542.html
Copyright © 2011-2022 走看看