Array Question
| From: | Phillip S. Baker | Date: | Tue, 18 Jul 2000 16:38:28 +0000 |
| Subject: | Array Question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-7098@lists.php.net to get a copy of this message | ||
Okay I want to populate an array with a variable (i think that is the way to state it)
Ok ay I am using this code
$d = dir("images/");
while($entry=$d->read())
{
if(($entry==".") OR ($entry==".."))
{
echo "";
}
else
{
echo $entry, "\n";
}
}
$d->close();
Now this code a list of images form the images folder and would return something likeimage1.gif, image2.gif, image3.gif Now I want to populate an array with this list of images that are pulled from this code. So I would want the above code to populate an array like $image = array("image1.gif","image2.gif","image3.gif"); So if I dumped image4.gif into the images folder the array would dynamically update to read.... $image = array("image1.gif","image2.gif","image3.gif","image4.gif"); How would I go about doing this in PHP 3 not PHP 4?? Thanks folks -- Phillip S. Baker phillip@wordsandimages.com Words & Images, Inc. 1535 Seabright Avenue, Suite 100, Santa Cruz, CA 95062 Direct Line (831) 420-2641 / Fax (831) 458-0808