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

Ariba 9r - SAP MM Integration
Hi experts,

The standard Ariba adapter for 9r creates a relationship between Cost Centers

Array disappearing in foreach loop
Okay, I have this problem where an array will become undefined in a foreach loop.

Here is the

include
Hi I have this way of licensing my PHP application, and I want to know if you guys can answer some q

Warning message
I've put a website that I was doing live and I'm getting this warning message when I try to add a ne

how to put the 0-100 numbers into 1.txt and 100-200 into 2.txt ?
how to put the 0-100 numbers into 1.txt and 100-200 into 2.txt and so on 200-300 into file 3.txt ?

Print out contents of to Excel
I have got this script that gathers all the data that I need but I need it to send it to excel inste

$_FILES array
Ok,

I just started experimenting with PHP today. My goal right now is to have people be able

Problems with strings containing
Hey all,

I have encountered something strange in a script. I am trying to write an XML heade

help with insert
Hi there,

I am trying to insert some data into a database, but for some reason, it is not ins

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

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