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

Format timestamp from mysql
When I tried this:
Code: date("m/d/Y H:i A", $row['timestamp'])
I got 12/31/1969 18:

preg-match with a string and numbers
Hi, I can't get the expression to work for my preg_match, what I'd like is for it to match the strin

unexpected T_SL without a shift left token
Nothing too see here, I'm an idiot and resolved the problem.

Open link with largest int string first
I have the following links i would like to open either all at once or one-by-one. How would i procee

Posting to another Site?
I have software that people install.
When they install it, is there a way to make it post their d

Bit manipulation program with binary operations
My homework is to create a program to scan in and add binary numbers and print them like so

strtotime issue
Hey all,

I'm playing around with some code, and basically the idea is:

Person changes

Download Image from URL and Upload it
Ok, I have been googling for the last 1/2 hour trying to figure this out, Most likely I'm just not s

True way to see if action was successful?
If this is a good way to see if action was successful to continue:

Code: function changeGa

tag inside php...
hi


Code: <?php
echo "<td width="$columnWidth%" align=&

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