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

Business Health Check
Hello

I need to create an online business health check for a client it will be multiple choi

Need help in Generating Combinations
Need help generating all possible combination of names in an array

Lets say i have the follow

User input in to variable
Hi all,

I'm sure this is very easy but I'm having another brain freeze!

At the end of

some questions
Hello,

I am looking for the answers for following questions:

1) Does PHP support overl

Having Problem with Date
l have a submit buttom where user have the possibility to add a date to specify when his message s

PHP Mysql Staff Induction System
Hi there, I'm pretty new to PHP and Mysql so could really do with being pointed in the right directi

Members Only
Hi all, for my website i have a members area only which on members can veiw, but at the moment anyon

Select question
Hi,

First I would like to say that php is pretty new for me..
so please don't shoot me if

PHP/Database issue
My friend is helping me make a database where you go to a certain webpage of my site and the page wi

Two warning messages
Quote<b>Warning</b>: mysql_real_escape_string() expects parameter 1 to

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