I'm developing a system where in some part of the client the client can send a ZIP
file containing only images.
I'm trying to do this in a way that I can extract from this ZIP
only the files that contain image-specific extensions.
I know that in PHP, when we are going to list only one type of extension in a directory, we use the glob
function to do this.
Is there any way to do a similar operation with class ZipArchive
of PHP?
If someone knows a plugin in Laravel
that does something like this, it will be very useful such information.
Note : The ZipArchive :: extractTo () method accepts a second parameter, which is an array of files of white list
of the files that will be extracted.
It would be nice if this also worked with a glob brace
!