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

highlighting search terms
well, I started this in the regular PHP section, but it no longer fits there. Suffice it to say, I'm

Creating a custom API
I'm creating a site, and I need to create a basic API. Unfortunately I have no idea where to start.

Xml parsing
I need a suggestion about parsing xml with multiply parts like pervious...
i.e. different device

Functions Not Loading Into Div
I had some help doing some of this but what I'm trying to do is get my functions to retrieve its val

Form errors in an array
I'm processing a form and putting the errors in an array. empty($errors) doesn't seem to do the tric

defining website tags
Hi,

What would be the best way to define tags for my site, such as website title, url etc.

Searching keywords from array
Hello everyone, Im just wondering if someone could help me with another issue im having. Im still le

php title problem
Hi,

I am having a problem managing my page title with PHP.

Currently I have my <

Parse String
I need to parse the string below into three variables. How would I do that?

john + 10/20/2008

Logging and nologging bulk insert
Hi,

oracle version: 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production

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