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

need to add "sizes" to shopping cart
Hey guys, I am trying to figure out a way to add a "size" selector on to this bit of code.

problem with php mysql query
Hi guy's...

I'm totally lost here..because don't have any idea how to make a query for grab r

validating url
im trying to validate url's sent to me by a form
the url's im collecting are for placing banners

Save file by click
Hello.
I'm not understand how to save file from page. I'd like make link to file with save abil

Simple Scraper... Weird Output
Okay, maybe I just need a Blue Monster and some sleep, but....

I'm scraping a ringtone site

Help on query replacing the date
Hi Pals,

i want to replace the current date in a column to some value say C or D or any n

Else statement screws up all css
Does anyone know what goes wrong in the process with this php code?
This code seems to be causing

PHP form help required
Hi all! Apologies in advance for having to message the forum for help. I know you must get a lot of

On page view, minus credit
Hello all, please, I need a little help with this script. I am charging one credit (credits can be p

php form help
Hey,

I use a control file to set my meta tags and titles

Here's an example
Code: &a

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