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

alt text

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?

  1. 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

  2. Store in the EXIF ​​file all the "human" names of the directories to it and the description itself.

  3. ... your implementation?

  • It makes no sense to create php-configs in this case - filling in time will take no less than if static html-files were simply created manually. EXIF is generally a good option, but reading it out is too resource-intensive. The first thought that can come to solve the problem is to simply create text files with the same text as files / folders with the necessary text in the form of content — simple, quick to implement, easy to change. - Indifferent
  • No one else wants to advise anything, make the answer - I will accept! - ferrari
  • one
    The last option from @ Indifferent, just change a little: create a similar directory structure in another folder (level above) and keep the same name files with a description in it. Then, when working with paths having a path ./photos/kitchens/ferrero/day_n_night/00.png access to the description is obtained by simply replacing the path ./descr/kitchens/ferrero/day_n_night/00.png You can change the extension :-) - Johny

1 answer 1

And why don't you want to use the base now ? If you simply do not want to start a separate service, it may be worth looking in the direction of SQLite .

It’s pretty easy to work with PHP, and its convenience and flexibility is almost the same as MySQL.

  • I am just considering the options, it may have to tie the base. - ferrari