PDA

View Full Version : use php to browse folder structure


mdo4
02-24-2003, 01:17 PM
Hello:

I'm implementing a photography site in PHP with a large number of photos. To top it off, mySQL is not available on the host so I'm placing photo data in a large array. To ease the data entry nightmare of entering all applicable photo data into this array, I have this question: Is there a way to use PHP to 'crawl' the server file structure and access photo info such as width and height? When I view my image files, dimension information is seen when viewing my folder in details mode, is this information available programmatically?

- Mike

scoutt
02-24-2003, 06:17 PM
sure is. look into readdir() and getimagesize()

the readdir() will le tyou read a directory of a specific file format, then once you get the image you want you can view the size by getimagesize().

all this can be found in the php manual

mdo4
02-24-2003, 06:35 PM
Great!!! Thanks for the info, just to give PHP props, I just started getting into it and I am blown away by it's capabilities. JSP was always too complicated, ASP was always evil-empire coding, this is truly an impressive technology.