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

Multidimensional Array into an Html table, help!
Hello all, I am new to HTML/PHP so any help would be great.

I have a multidimensional array f

Tree Menu
Hi guys,

Can anyone help me making a tree navigation system? I have a site where I'm allowin

Sequre login with cookies.
I want to build secure login with cookies. I just want your ideas about this, your suggestions. What

remove a ; from emails in textarea
Code: <?php

session_start();

$database_host = "localhost&qu

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

PHP loop
Okay so I have several "articles" stored in a mysql database and am attempting to echo tho

How to generate a text file using php...?
Hi,
Can anyone give me code to generate a text file using php


Thanks in advance

Option box to change variable
Hello, i need help by making a script!

I need to write a file with option box, so a dropdown

Saving data from a form into a file
Hey everybody,

Sorry, I am really new to PHP coding and such but a project kind of got thrust

Open/Close Links in Php
Hello, Hoping someone can inform me how I can get PHP to automatically open a set of links in a new

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