RE: [PHP] creating a text file

From: Date: Thu, 10 Apr 2003 15:08:22 +0000
Subject: RE: [PHP] creating a text file
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-143350@lists.php.net to get a copy of this message
Hope this helps $h = opendir('./foo/photos'); while($file = readdir($h)) { if(is_file($file) === true) { // do something with the file } } closedir($h); -----Original Message----- From: Tyler Durdin [mailto:linuxgeek23@hotmail.com] Sent: Thursday, April 10, 2003 11:52 AM To: php-general@lists.php.net Subject: [PHP] creating a text file Is there a way to make php create a text file that lists contents of a directory? This is what I use from shell: csh -c "ls *jpg > list.photos" I have a photo gallery that reads the images in a directory from a text file. I would like to eliminate the manual creation of that file. If there's a better way to do it, maybe firing it into a db instead of a textfile or having php read the contents of the directory without creating a text file, please let me know. I appreciate the help. Durdin _________________________________________________________________ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#143350) next »