duandange7480 2012-11-19 18:31
浏览 53
已采纳

PHP glob选择2个文件夹

How can I get a listing of all files from multiple folders using the PHP glob() function?

Something like this: glob("data/['folder1', 'folder2']/*");

  • 写回答

2条回答 默认 最新

  • doushijiao0679 2012-11-19 18:37
    关注

    As described in the documention for glob, you can expand {a,b,c} to match a, b, or c as long as you use the GLOB_BRACE flag.

    glob("data/{folder1,folder2}/*", GLOB_BRACE);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?