我有以下文件夹结构。我只想获取目录(不是子目录)和文件的名称。我怎么能用 PHP 做到这一点?谢谢你。
Main Directory
Directory1
SubDirectory1
File1
File2
SubDirectory2
File3
File4
Directory2
SubDirectory3
File5
File6
SubDirectory4
File7
File8
结果应该是这样的:
Directory: Directory1
File: File1
File: File2
Directory: Directory2
File: File3
File: File4