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);
?>
등록된 댓글이 없습니다.