使用PHP扫描当前文件夹

kmu*_*nky 3 php filesystems directory

我有这样的文件夹结构:

/articles
     .index.php
     .second.php
     .third.php
     .fourth.php
Run Code Online (Sandbox Code Playgroud)

如果我在second.php中编写代码,我该如何扫描当前文件夹(文章)?

谢谢

Dav*_*nes 5

foreach (scandir('.') as $file)
    echo $file . "\n";
Run Code Online (Sandbox Code Playgroud)