luigimia Posted December 28, 2011 Share Posted December 28, 2011 Hi. I want to create a list of files in a directory. But I don't want all the files to be listed, only .gif, .jpg and .bmp. Does anyone know the PHP code how to do that? (My directory name is 'images' if you need that). Thanks! Link to comment https://forums.phpfreaks.com/topic/253923-listing-only-a-certain-type-of-file-in-php/ Share on other sites More sharing options...
scootstah Posted December 28, 2011 Share Posted December 28, 2011 $files = glob('images/{*.gif, *.jpg, *.bmp}', GLOB_BRACE); Link to comment https://forums.phpfreaks.com/topic/253923-listing-only-a-certain-type-of-file-in-php/#findComment-1301750 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.