
get_included_files 함수는 PHP에서 사용할 수 있는 내장 함수로, 현재 스크립트가 포함한 모든 파일을 반환합니다.
1. get_included_files 함수를 사용하는 방법은 다음과 같습니다.
#hostingforum.kr
php
$included_files = get_included_files();
print_r($included_files);
위 코드를 실행하면 현재 스크립트가 포함한 모든 파일의 경로가 출력됩니다.
2. get_included_files 함수는 PHP 파일만 반환할 수 있습니다.
3. get_included_files 함수를 사용하여 특정 파일을 제외하고 목록을 만들 수 있습니다.
#hostingforum.kr
php
$included_files = get_included_files();
$excluded_files = array('파일명.php');
$included_files = array_diff($included_files, $excluded_files);
print_r($included_files);
위 코드를 실행하면 현재 스크립트가 포함한 모든 파일 중 '파일명.php'를 제외한 목록이 출력됩니다.
2025-07-31 15:02