분류
php
include 사용법
본문
php에서 외부 화일을 삽입하는 include 사용예를 살펴봅니다.
1. 여러번 중복이 될 수도 있는 include
<?php include("ex.php"); ?>
2. 화일내에서 오직 한번만 include
<?php include_once("ex.php"); ?>
3. 사이트의 root기준으로 include
<?php
$path = $_SERVER['DOCUMENT_ROOT'];
$path .= "/lib/config.php";
include_once($path);
?>
- 이전글page 함수 15.05.07
- 다음글랜덤 백그라운드 처리하기 15.05.07