array from folder

From: Date: Mon, 25 Apr 2005 17:24:39 +0000
Subject: array from folder
Groups: php.general 
Request: Send a blank email to php-general+get-213815@lists.php.net to get a copy of this message
Can PHP generate an array based on file names in a folder? For example, if I have a folder called "photos" that includes three files -- tree.jpg, house.jpg and boat.jpg -- can PHP "look" at the file and generate a variable $photos= array ("tree", "house","boat"). Any ideas for how to "sniff" out a folder to determine how many files are in it and then create an array with the file names in it? Thanks, Ed Ed Dorsch Development Communications University of Oregon 541.346-0605 <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> "You can't wait for inspiration. You have to go after it with a club." -Jack London

« previous php.general (#213815) next »