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! Quote 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); Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.