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

How to get the previous months last date....
Here's my wittle problem. I suck at working with dates.

So today is 10/20/2009, i need to fig

$variable = $variable
Hello

Sorry if this is a really simple question but I have run out of ideas. Is there a reall

php + mysql count consecutive data
I have a database of values and I want to work out how to display them if the values match a consecu

Join Query Help
Hi all,

I am having problems with the below code, which we shall call 'my first join query'!

image upload script not working with png
The basic process of this php code is to take the submitted file, convert it to a small JPG thumbnai

How to return to a previous page after running a PHP script
I'm having a bit of a melt down here because I think this should be really easy but can't work it ou

post to self
Trying to get my form to submit to itself. However I am also trying to use an image for my submit bu

what does this mean? +=
is anyone able to explain what this code is saying?

i had it written for me awhile back and n

use an array from 1 class in a second class
I have a class that adds data to an array

Then I have a second class and I need to check if t

webpage with (simple) login & mysql-db
Hi all,

What I was looking for before was a multi-user password manager, web-based! The offer

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