I'm wondering if the following can be achieved easily enough with some PHP scripting:
What I'd like to do is, read the names of all the image files in a certain web directory, and search for any occurrence of each of these image names within all the text files (html/css/php/whatever) of some other directories, and if they're not referenced there, to delete the images from the image directory.
The idea is to throw away images that were made during the development of a website but which aren't any more being actually referenced by the web pages.
I'd be grateful for any pointers. Thanks.