| | |||||
| ||||||||
| CODE This forum is for posting code snippets and example scripts that aren't quite tutorials, but could be useful for others. You may post code snippets and/or completed scripts that you've written and want to share here. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Senior Member Join Date: Aug 2005 Location: Uk, South Yorkshire
Posts: 1,228
![]() ![]() ![]() ![]() ![]() ![]() ![]() | [PHP] Display random images (from a directory) There are many scripts and tutorials out there that let you display random images. Most of them require you to specify which images to show… which can be a pain writing out what images you want to display, especially if there is a lot of them. Which is why i wrote this PHP function, to make it simpler. Instead of listing the files, just specify which directory contain the images you want displaying. This script will “scan” your specified directory, and display the files randomly. (Given they have a image extension of .jpg, .jpeg, .gif, .png, .ico) The Code PHP Code: PHP Code:
Enjoy! |
| | |
| | #3 (permalink) |
| Senior Member Join Date: Jun 2008 Location: nodws.com
Posts: 1,666
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | lol, just name images as numbers. 1.jpg,2.jpg, etc. will save tons on CPU resources
__________________ SnackNames.com | SnackDesign.com | buckstabu.com | adoolt.com | yoAmoNY.com Developer For Hire! PHP/MySQL/Wordpress/Etc Graphic design, Corporate ID, Dev Ideas |
| | |
![]() |
| Tags |
| cueburst, php, random image |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |