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

question about header() security
is is safe to just use the header() function to redirect someone if they are, say, not logged in? or

add to sql result
ok see rite now my sites hit counter is counted from the mysql visitor log i need to clear it aft

Socket problem
Hello,

Earlier I posted about my problem with my socket script. It took up to 100% CPU usage.

php redirecting
i wont open a new thread but i have a question about redirecting....
i wonder why my code doesnt

Motivational Posters
Hello,

I wonder how can i do them in php. Are there any sample codes that you can show me?

mail()
Hi all. I have a problem with emails. I am trying to set up a mail system where customers can subscr

Creating web pages by php
Hello again,
I was just wondering us there a way to use a php script to create a new web page. I

db entry based on primary key
My "topics" table contains 10 entires
*--------------*
topicid topic
------

urldecode question
How would I format this line of code properly?

<?php echo urldecode($_GET['Title']); ?

Help Optimizing code
Good Morning,

I wrote a small import function for a website of mine and I know there has to b

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