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

Stopping page post back
I have few literal contriols in my page and a repeater too. But inspite of using update panel, postb

values not being entered into table
hi. I;ve created a form, so that when a user enters data into it, it gets added to a table in a data

PHP FTP Can't upload Big FIles
Anyone had any success using FTP to upload a file say 90m?

im using ftp_put and it returns fa

Prevention Help
How can I use PHP or any other language (feel free to move this thread) to prevent users doing scree

Help with search.php
Hello All

I need the search engine on a site I am building at the moment to display the searc

PHP and MySQL Question/Help
I have a MySQL db with all my servers and all their details like server name, IP, OS, RAM etc etc 26

How to replace search button with link?
hi to everbody.
i have a search submit form and button like this :

<form id="f

Receive Rosettanet Message to SAP 4.6c
Dear all ,

My customer will send the PO details by rosettanet message , Is it

array_count_values question?
ok i'm trying to create a top ten list from a database of listed favorite movies.

the followi

Access database inside of a validation class
Hello,

For quite some time, I have been using functions to validate form input and access the

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