_common.php을 만들지 않고 아래 코드를 직접 넣어서 사용.
또는 _common.php의 내용에 넣어서 사용.
[code]
<?php
function find_common_php() {
$current_dir = dirname(__FILE__);
$parent_dir = "../";
$count = 0;
while (!file_exists($current_dir . "/common.php")) {
$current_dir = dirname($current_dir);
$count++;
if ($current_dir === '/' || $current_dir === '.') {
break;
}
}
return $count;
}
$up_count = find_common_php();
$include_path = str_repeat('../', $up_count) . 'common.php';
include_once($include_path);
[/code]
댓글 10개
게시글 목록
| 번호 | 제목 |
|---|---|
| 24149 | |
| 24140 | |
| 24133 | |
| 24125 | |
| 24119 | |
| 24109 | |
| 24105 | |
| 24101 | |
| 24093 | |
| 24089 | |
| 24077 | |
| 24074 | |
| 24071 | |
| 24070 | |
| 24067 | |
| 24056 | |
| 24050 | |
| 24046 | |
| 24043 | |
| 24040 | |
| 24037 | |
| 24036 | |
| 24035 | |
| 24034 | |
| 24021 | |
| 24017 | |
| 24005 | |
| 24002 | |
| 23990 | |
| 23980 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기