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

Did you know?Explore Trending and Topic pages for more stories like this.
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

Text to picture Generator
Hello, i have found this script and it works really good^^ But i have one problem, i would like to c

Loop Through Date Range
Hi guys,
I have date range as parameter like 01/JAN/2009 TO 16/JAN/2009 now i want to loop thro

problem with php server update from mid 2009
Hi,

I have this navigation menu on 2 websites which used to work just fine. After a recent up

preg-match with a string and numbers
Hi, I can't get the expression to work for my preg_match, what I'd like is for it to match the strin

I am stumped
OK. Here is what I am trying to do. I have the conditions set, and if the conditions are met, I want

Saving data from a form into a file
Hey everybody,

Sorry, I am really new to PHP coding and such but a project kind of got thrust

Add a sign-up feature to a flat file login script
I'm working on a flat file login script and I would like to add a sign-up feature to it with a email

Comma seperated implode & modifying returned string.
I have a PHP post form that posts up to 4 variables. I need whatever variables are passed to be comb

WORDPRESS - Multiple Loops Only Going to One Post?
I have various pages with multiple loops and i need them to be individual to all other categories.

MYSQL INSERT ID NOT WORKING
Code: $id = mysql_insert_id();
header("Location: ./?view=$id");
Why $id pulling blan

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