PHP glob select 多个文件夹

PHP glob select multiple folders

如何使用 PHP glob() 函数从多个文件夹中获取具有特定扩展名的所有图像的列表?

$images = glob("data/{'./assets/img/post/birthday-wishes/*.png','./assets/img/post/birthday-quotes/*.png'}/*", GLOB_BRACE);
echo $images;

如果有帮助请尝试此代码

$images = glob("data/{assets/img/post/birthday-wishes/*.png,assets/img/post/birthday-quotes/*.png}", GLOB_BRACE);
echo $images;

在 glob() 函数中使用多个星号

$images = glob('./assets/img/post/*/*.png');
print_r($images);