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 Subdomain Name With PHP?
I want to grab the subdomain name with PHP so I can generate database queries.

for example my

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

Data storage spaces in varchar2
Trying to understand what's happening.
I am selecting a value from a table that is defined as c

Disable html within defined tags
I have a mysql database that allows users to enter content with html, but I also want to have a tag

How to secure my login data to my database?
Hi there,

It may be a stupid question but I don't know how to secure my login data to my data

Need help with basic sql
Hi,

I am using oracle 10g, and having some small doubts related to sql , here goes the si

Random Number Generation And Probability
Hello, I am working on a function which has to insert data into a SQL table.

we have to suppl

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

date function help
i need help with date function

Code: [Select]<!DOCTYPE HTML PUBLIC "-//W3C//DTD H

UDP Multicast question
Hey,

Im not really in the know when it comes to network related programming and activitie

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