There is a large gallery of photos, made in this way:

scandir returns an array, everything is fine parsed and displayed. Only now you need to attach a description to each photo, and a more detailed name to each folder, i.e. let's say
kitchens -> Кухни для детей ferrero -> Ferrero De Legno 2013 day_n_night -> Коллекция День и Ночь 00.png -> Оригинальное решение для детей от 5 до 10 лет. I don’t want to change the structure at all, the base is not used :( Tell me an idea how to bind "data" to files?
I invented in the root of each folder to hang something like _details.php where there will be an array of matching the names of files \ folders with "human" text
Store in the EXIF file all the "human" names of the directories to it and the description itself.
... your implementation?
./photos/kitchens/ferrero/day_n_night/00.pngaccess to the description is obtained by simply replacing the path./descr/kitchens/ferrero/day_n_night/00.pngYou can change the extension :-) - Johny