Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个文件夹,我正在尝试获取所有文件名和文件扩展名。我怎么能这样做?我找不到任何有用的例子来做到这一点,如果有人可以帮助我,我已经厌倦了寻找它,我将不胜感激
谢谢
Dir.glob("*") # => ["test.rb", "a.txt", ..... ] # or find all files recursively Dir.glob("./**/*")
你可以使用php函数scandir('path')
scandir('path')