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

duplicate record notification
In my database, after insertion of records, I want to know if the record inserted is duplicate or no

Allowing ' and "
Hello everyone,

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

same querie, or a new one??
Hi guys,

I'm still working on this drop down list. I've got the actual drop down list to wor

a function to check directory depth
I'm working on a php script to upload files in to a set directory.
the user can select to upload

PHP Search Issue
Hi, I am using the following code to search and return flights from a database. The user searches by

help with email script...
hey

I need help with my mail script

when the form on http://www.mcgdesignstudio.com/c

output_buffering so rewrite
I'm planning to rewrite some of my scripts so they don't have to use output buffering to accomplish

Calander layout
Hi i know this sounds like a simple question but i cant find the answer to it anywhere i have added

get the country of visitor and display content based on that
Hello all,

I have seen that Google analytics can tell you where a visitor is coming from and

javascript in php code causes page to display white
Hi All,

Odd one this, I've got the following code (below) which is a simple log in form. The

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