
PHP의 include 경로를 변경하고 싶을 때, `set_include_path()` 함수를 사용합니다. 이 함수는 include 경로를 변경합니다.
#hostingforum.kr
php
// 원래 include 경로
$include_path = get_include_path();
echo $include_path . "n";
// include 경로 변경
set_include_path('/path/to/new/include');
echo get_include_path() . "n";
// 원래 include 경로로 돌아가기
restore_include_path();
echo get_include_path() . "n";
위 예제에서 `set_include_path()` 함수를 사용하여 include 경로를 변경하고, `restore_include_path()` 함수를 사용하여 원래 include 경로로 돌아갑니다.
`restore_include_path()` 함수는 include 경로를 변경한 후에 사용하여 원래 상태로 돌아갈 수 있습니다.
2025-07-30 19:40