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

please fix the error
What is the error in the below code ???
Line number On/Off | Expand/Contract <?php

Vertical Alligning - Not working in 1 cell?
<?php

echo "<table id="valign" width="60%" style=

Stumped by Third Day of Month problem
I am trying to build an algorithm that will essentially do this:
Code: [Select]$this_month = Oct

Operating System
How in PHP or other language can I detect Operating system, ie Windows XP Home, Windows 7 Ultimate,

extract content from a website
i have written a code that will grab the content from the index page..
i would like to know how c

Convert .fdf to .pdf
I currently have a web form that uploads the form data to an .fdf file and emails it.

However

Echoing ASCII code
I have a php page that splits a string into chars and then echoes the ASCII code for each char. I'm

trim function issues
Hi guys, total noob here...

So I've been tinkering around with a html and am using php to em

scandir clients directory
hi,
how can i scandir the clients directory? i need a script that when i click a button it will u

MySql timezone
Code: $sql = "SELECT *, date_format(date, '%m/%d/%Y at %I:%i %p' )as date FROM comments WHERE t

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