
PHP의 내장 함수나 라이브러리를 제외하고 싶다면, `get_included_files()` 함수의 결과에서 내장 함수나 라이브러리의 이름을 직접 제외하는 방법을 사용할 수 있습니다.
예를 들어, 내장 함수나 라이브러리의 이름을 배열에 저장한 후, `get_included_files()` 함수의 결과에서 해당 배열의 항목을 제외하는 방법을 사용할 수 있습니다.
#hostingforum.kr
php
$exclude_files = array('php.ini', 'php_network_getaddresses.default', 'php_network_include_path.default');
$included_files = get_included_files();
$filtered_files = array_diff($included_files, $exclude_files);
print_r($filtered_files);
또는, `get_included_files()` 함수의 결과에서 내장 함수나 라이브러리의 이름을 포함하는 항목을 제거하는 방법을 사용할 수 있습니다.
#hostingforum.kr
php
$included_files = get_included_files();
$filtered_files = array_filter($included_files, function($file) {
return strpos($file, 'php.') !== 0 && strpos($file, 'php_network_') !== 0;
});
print_r($filtered_files);
이러한 방법을 사용하여 PHP의 내장 함수나 라이브러리를 제외한 로드된 파일의 목록을 얻을 수 있습니다.
2025-03-31 03:38