show random images


Posted on 16th Feb 2014 07:03 pm by admin

hey guys

can someone please suggest a way in which the following code can be edited so it only picks up .jpg files, and so it only shows 20 of them which where found, in a randomized order

Code: <?php
$files = new RecursiveDirectoryIterator("./gallery");
foreach(new RecursiveIteratorIterator($files) as $files)
{
$file = basename($files);
echo ''.$file.'<br/>';
}
?>


thanks everyone

No comments posted yet

Your Answer:

Login to answer
190 Like 39 Dislike
Previous forums Next forums
Other forums

Amatuer requiring assistance
Beginner and amateur in need of assistance

My Site - (Spare Parts for Domestic Appliances)

Working with Dates, help.
Sooo to make a long story short, here's what im trying to accomplish.

I need to create a drop

Allowing ' and "
Hello everyone,

I am creating a form where users submit information to go into a database. I

Time script, set to my time zone?
I am using this line to get the date and time

Code: $time = date(F." ".d.", &q

session checking in page load
hai all I have a web site is www.Mryas.com in this my login page is Page1.aspx its co

mysql VARCHAR acting like INT
Hi, All.

I have a table that contains a varchar(10) column named weird_field. In this column

Required to login help
I'm trying to set up my site so users have to be logged into the forum to access the site.I've been

Images in email problem
I found this script for sending emails, it works but if the email has <img src="image.jp

Help with PHP and checkboxes
I am posting this for a friend of mine, i wrote a small script for her to process her form data to a

Saas with SAP R/3
hi experts,

Is SaaS offer available in SAP? for SAP R/3? from where i can get the info a

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash