_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개
게시글 목록
| 번호 | 제목 |
|---|---|
| 21529 | |
| 21526 | |
| 21521 | |
| 21516 | |
| 21513 | |
| 21502 | |
| 21485 | |
| 21471 | |
| 21467 | |
| 21457 | |
| 21424 | |
| 21421 | |
| 21415 | |
| 21410 | |
| 21406 | |
| 21405 | |
| 21394 | |
| 21378 | |
| 21354 | |
| 21349 | |
| 21345 | |
| 21316 | |
| 21299 | |
| 21297 | |
| 21279 | |
| 21276 | |
| 21254 | |
| 21242 | |
| 21214 | |
| 21206 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기