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

PHP error on MySQL insert
I'm sure it's the simplest of issues, but I can't recall why this isn't working.

Code: [Selec

asking for direction
I have 2 tables in my data, which are "post" and "event"
I won't make a summa

Php navigation
I have four buttons on a php page.
If i click a button it will redirect to different php pages.

Syntax Help
Code:


im having trouble with that code snipped
Parse error: syntax error, unexpec

IF Statement & Two Tables With Different Echoes
I'm retrieving two tables in a single query using UNION ALL, like so:

Code: $query = "SE

Simple Variable Question
Hi everyone.... again,

I am really getting into php still. Learning more every day. I love it

DELETE FROM not working deletes wrong row
Hello

I have the following code which i found but it doesnt work properly.. it comes up with

How to ask a regex question?
Hi, I thought I'd share some of my insight after seeing too many bad questions that either get ignor

please hep to get values from a table row
can anyone tel me how I can select and get data from one row by pressing an Edit button in that row

Variable Clash
In the past I've had variables clash. For example:

Code: <?php
$c = 5;
$ca

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