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

Help with ORDER BY
Hello. I would like to order by ascending States, then Cities, then Gyms in the following code, but

how to get values from $_Post with onchange="form.submit();"?
Hi, I have a form that submit to itself with a file upload field and two other hidden field values.<

Multiple Pages
Hi. Im very new to php. I'm trying to create a basic login/registration page.

So I have a bas

SAP Business Suite
Hi all:

Within the SAP Business Suite solution I would like to ask you the main differenc

How to add an image/C++ OpenGL?
Hi,

I have been trying to look online for this and, so far, I haven't found anything usef

search function
HI guys,

if anyone could point us in the right direction of how to do this, or provide some t

Sql and php order list script problems
Hi im having a few problems with trying to get the coding right on a orders list ive done (or trying

mr8m - reverse document
Friends,

I'm trying to reverse a document held by MIRO, but it reports the message balan

rdns with php
I am trying to build a script that will show all of the different domains that are hosted on the sam

filesize() returns 0
I have a socket program that runs in an infinite loop, listening for connections, in this socket I h

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