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

Getting PHP to ammended the selected in option field
Hey Guys

thanks for everyones help so far. This site and its users are oozing awesomness.

Batch Related Pricing
Hi, I need some clarity on the batch related pricing

For example the following are the b

Search function
I am looking for some guidance from the experts.

I am trying to create a search function. It

form variables from database help.
Hi all,

I would like to have a form that gives you options based on the results of an mysql q

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

image upload script not working with png
The basic process of this php code is to take the submitted file, convert it to a small JPG thumbnai

need help modifying script
Hi guys,

I'm fairly new to php and am having a bit of trouble modifying a script.

This

need help to creat database
Hello Team, please guys i am stuck from three days with paypal issue for IPN but no luck yet now i w

ME54/ME54N Conditional check for Release of PR
Hi Gurus,

My requirement is to put a check on the release of the PR with respect to the c

captcha error
I have been trying to implement a captcha in php...

here is the code..
Code: (php) [Select

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