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

problem when runing a funciton
I am trying to connect to database using a funciton in a functions.php

<?php
funct

Pop-up Banner
Hello Friends,I need to use banner in our client site.Example: www.example.com if i enter this site

Concatenate two strings ???
I have string one $string1 and another $string2.

How to concatenate (add) both of them $str

Show specific day of the week
I have been racking my brain trying to get this function to work properly and it is doing so for eve

$_FILES array
Ok,

I just started experimenting with PHP today. My goal right now is to have people be able

Generate PDF
Hi guys,

I would like to know if there is a way to generate pdf when clicking on a link. In f

Edit MySQL Row Using PHP and HTML Form
Hello,

Here's what I'm trying to do. Build a page where a user enters a MySQL row number in.

Just a white page
Okay so, my website, when I click SignUp on it it takes me to /join.php but its a complete white pag

standard ALV application toolbar, into custom report....
HI,

I have a question regarding displaying standard ALV menu path and application toolbar

How can use this array as a key?
Say I have this array for example:


print_r($array);

Prints:
Code: [Select]Array

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