지정된 경로에 포함된 모든 파일의 이름을 배열로 반환합니다.
$filePath = 'vfs://root/Response';
get_filenames($filePath);
Array
(
[0] => Api
[1] => Blog.php
[2] => Blog.php
[3] => Cache.php
[4] => Cache.php
[5] => Caching.php
[6] => Cell
[7] => Custom.php
[8] => Data.php
[9] => Download.php
[10] => Exam1.php
[11] => Exam4.php
[12] => Example.php
[13] => Home.php
[14] => Home.php
[15] => Home.php
[16] => Home.php
[17] => Home.php
[18] => Home.php
[19] => Home.php
[20] => Home.php
[21] => Http
[22] => IcuSample.php
[23] => Lang.php
[24] => Layout
[25] => Locale.php
[26] => Localization
[27] => Loop.php
[28] => Loop.php
[29] => MyLayout.php
[30] => Page.php
[31] => Parser
[32] => Render.php
[33] => SetOutput.php
[34] => Simple.php
[35] => Table
[36] => Test.php
[37] => View
)
파일 이름의 일부로 경로를 포함하고 싶다면 두 번째 매개 변수를 `true`로 설정합니다.
$filePath = 'vfs://root/Response';
get_filenames($filePath, true);
Array
(
[0] => vfs://root/Response/Api
[1] => vfs://root/Response/Api/Exam1.php
[2] => vfs://root/Response/Api/Home.php
[3] => vfs://root/Response/Cell
[4] => vfs://root/Response/Cell/Blog.php
[5] => vfs://root/Response/Cell/Cache.php
[6] => vfs://root/Response/Cell/Home.php
[7] => vfs://root/Response/Http
[8] => vfs://root/Response/Http/Caching.php
[9] => vfs://root/Response/Http/Download.php
[10] => vfs://root/Response/Http/Home.php
[11] => vfs://root/Response/Http/SetOutput.php
[12] => vfs://root/Response/Layout
[13] => vfs://root/Response/Layout/Home.php
[14] => vfs://root/Response/Layout/MyLayout.php
[15] => vfs://root/Response/Localization
[16] => vfs://root/Response/Localization/Home.php
[17] => vfs://root/Response/Localization/IcuSample.php
[18] => vfs://root/Response/Localization/Lang.php
[19] => vfs://root/Response/Localization/Locale.php
[20] => vfs://root/Response/Localization/Test.php
[21] => vfs://root/Response/Parser
[22] => vfs://root/Response/Parser/Exam4.php
[23] => vfs://root/Response/Parser/Home.php
[24] => vfs://root/Response/Parser/Loop.php
[25] => vfs://root/Response/Parser/Render.php
[26] => vfs://root/Response/Parser/Simple.php
[27] => vfs://root/Response/Table
[28] => vfs://root/Response/Table/Custom.php
[29] => vfs://root/Response/Table/Example.php
[30] => vfs://root/Response/Table/Home.php
[31] => vfs://root/Response/View
[32] => vfs://root/Response/View/Blog.php
[33] => vfs://root/Response/View/Cache.php
[34] => vfs://root/Response/View/Data.php
[35] => vfs://root/Response/View/Home.php
[36] => vfs://root/Response/View/Loop.php
[37] => vfs://root/Response/View/Page.php
)