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

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

newbie question
Hi out thereIm totaly new in this forum and to .net and vb so here is a totaly newbie question.I wan

button help
i originally had this but realised it is much easier to have a button.

Code: <?php

Form help: Syntax & Logic
Hello again all,

I'm working on a form and ran into a wall (again) and can't seem to think th

Help with PHP and checkboxes
I am posting this for a friend of mine, i wrote a small script for her to process her form data to a

Help with setcookie()
Merry Xmas to those on this foruum
Older guy here with some experience but not allot so please be

Table control is disappearing from Screen
Hi Experts,

I have a screen with multiple table control(TC). Each table control has two c

keeps going back to index.html ???????
ok so i started making my site using mostly.html files now i have added a fair chunk of php. My inde

Registration
ok so i have a site where people can register and login which works now thanks to someone on here th

how to easy edit text, with box? Help.
Hi.
I have a little problem. I'm doing a webpage for my aunt and I would like to make it as easy

Strange PHP/mySQL error ... am I just tired?
Code: <?

## CONNECT TO DB FUNCTION!
function ConnectTo($db2con)
{
$hostNam

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