filter scandir and sort by date created
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I need to get the files in a directory in an array. Only files that end in .markdown The files should be sorted by date created Efficiency is not a huge deal, but I always like to make things as efficient as possible. There will be multiple directories with up to a couple hundred files in each. I know I use the scandir function to get the files into an array, but I'm not sure where to go from there. I could throw it in a loop to check if the files end in .markdown , but is there some sort of regex I could pass in to the scan? Thanks 回答1: You