Re: Re: creating a text file

From: Date: Thu, 10 Apr 2003 15:43:21 +0000
Subject: Re: Re: creating a text file
Groups: php.general 
Request: Send a blank email to php-general+get-143359@lists.php.net to get a copy of this message
I have tried that, but I can't figure out how to then change my variable: $data_file = "pictures/pictures/list.photos"; to access the info in the script below or similar scripts. How can I get the variable $data_file to read the file names from the script below?
Try something like this: if ($dir = @opendir('/path/to/pics') {
    while (($file = readdir($dir)) !== false) {
        if(strpos($file, ".jpg")>0) {
	    $names[] = $file;
    	}
    }
    closedir($dir);
    sort($names); // optional
} HTH, Karsten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
_________________________________________________________________ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

« previous php.general (#143359) next »