I have several folders with images that I need, by PHP, to delete all the .JPG files before starting a certain function, without deleting the subfolders that are inside.
How can I make this function delete the JPG without deleting the subfolders?
The folder looks like this:
imagem/01.JPG
imagem/02.JPG
imagem/original/01.JPG
imagem/original/02.JPG
I want to delete only the first 2 "image / 01.JPG and image / 02.JPG"