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 help with cin setw
I made a program here is my code:

#include
#include
#i

Different actions for different parts of a string
<?php
function dosomething($string, $else = '') {
if (empty($else))
$string

DATEDIFF Question
First time post, and of course it is a help question.

I am using a WP plug-in to display prev

Multi image upload
I have a gallery to build and want to build a dynamic upload form to allow for $var number of fields

A problem with my GD class
Hello,

I created a nice (and simple for now) GD class.
The problem is , it works great on

While Problem
i am having a problem with a while statement here is the code
Code: [Select]<?php
sess

Using Curl_multi for processing multiple URLs
Hi,

I am at a loss as to how to implement this. I would like to be able to automatically assi

Quick fix: Conditional statement with an array
Hi, I'm getting the temperature value off of the Environment Canada website along with the icon file

reading xml faster than DB call?
I am trying to optimize a high traffic website, and I enabled a feature where there are three photos

Anti Spam Code
Ok where do i start? Probably by telling you I have very little working knowledge of PHP and that I

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