Created
August 13, 2009 20:50
-
-
Save dewski/167444 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $imglist = array(); | |
| //$img_folder is the variable that holds the path to the banner images. Mine is images/tutorials/ | |
| // see that you don't forget about the "/" at the end | |
| mt_srand((double)microtime()*1000); | |
| //use the directory class | |
| $imgs = dir('./'); | |
| //read all files from the directory, checks if are images and ads them to a list (see below how to display flash banners) | |
| while ($file = $imgs->read()) { | |
| if (eregi("gif", $file) || eregi("jpg", $file) || eregi("png", $file)) { | |
| $imglist[] = $file; | |
| } | |
| } closedir($imgs->handle); | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment