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

PHP/PKI
I am trying to set up a web application that uses pki. does anyone have a good tutorial to set this

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

Please help understand this code
I noticed the index page on my site was modified this morning and found this code inserted at the bo

Remore client postprocessing phase getting dump SAPSQL_ARRAY_INSERT_DUPREC
Hello Expects,I have started remore client copy. Data was copied successfully. but while running pos

small inaccuracies
I have this code to convert fractional base 10 into base 2:

while($num > 0)

2 things: enter doesn't work in IE & empty form
i have this search form that works well except for 2 things.

1) on IE when i hit enter instea

Am I setting up my sites oldschool?
Ok,

When I create a site I open a basic template that I have created that consists of a css f

[RESOLVED] Socket/Port remains open after app crashes
I'm having this problem with a networked app in vb.net.

If the program exits normally the por

Customizing message/behavior
Hi,I'm using the ASP.NET membership/authorization controls in my application. Some parts of my appli

mail with attachment problems
Hi. I have the following code:
Code: else if(file_exists("site".$timp.".zip")

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