PHP - Reading a directory and fetching from a database

My main reason is to get an opinion on the different options. I have files / thumbs in the directory that are associated with the video, and when I have to get them, I use the glob () function glob (DIRECTORY./file_name*.jpg); and it returns an array of all jpg video files.

The glob function itself is very fast, but I'm still worried about using it, because there can be from 20 to 50 videos on each page, so there will be from 20 to 50 glob calls, I must continue to use them or start entering data into the database to extract a list of files from there instead of glob ();

if there is a better alternative, let me know.

Thank.

+5
source share
2 answers

, , , : .

- , , , . , : ? , , -, , .

? 1%? 10%? 50%? , , .

, ? , ? , , , , .

, , , , , . , . , , . , , . .

, , , , . , .

, , , , . , . az, , "a" "a", , "b" "b" .. , , , , , .

( :)

, , , , - , http://memcached.org/. : , , , , , , ; , , glob. , , .

+6

, , . , , , . . , . , , 123 4 , :

/path/to/video_123/thumb_01.jpg
/path/to/video_123/thumb_02.jpg
/path/to/video_123/thumb_03.jpg
/path/to/video_123/thumb_04.jpg
0

All Articles