| From | Sent On | Attachments |
|---|---|---|
| Phillip S. Baker | Jul 18, 2000 9:38 am | |
| Matt McClanahan | Jul 18, 2000 9:58 am | |
| Jon Parise | Jul 18, 2000 9:59 am |
| Subject: | Array Question | |
|---|---|---|
| From: | Phillip S. Baker (phil...@wordsandimages.com) | |
| Date: | Jul 18, 2000 9:38:06 am | |
| List: | net.php.lists.php-general | |
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 like
image1.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
phil...@wordsandimages.com Words & Images, Inc. 1535 Seabright Avenue, Suite 100, Santa Cruz, CA 95062 Direct Line (831) 420-2641 / Fax (831) 458-0808





