random file from subdirectories?

This is a discussion on random file from subdirectories? within the PHP Language forums, part of the PHP Programming Forums category; Hi, how would I make a script that pics a random file from a tree? Is there something like this ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-13-2003
Oliver Spiesshofer
 
Posts: n/a
Default random file from subdirectories?

Hi,

how would I make a script that pics a random file from a tree?
Is there something like this existing? I need one that can handle many
files on a large tree.

thanks

Oliver

Reply With Quote
  #2 (permalink)  
Old 09-13-2003
Martin Wickman
 
Posts: n/a
Default Re: random file from subdirectories?

In article <Xns93F5AF545EAE3oliveremailch@63.223.5.254>, Oliver Spiesshofer wrote:
> Hi,
>
> how would I make a script that pics a random file from a tree?
> Is there something like this existing? I need one that can handle many
> files on a large tree.


Read all filenames into an array using readdir et al, and then

$random_file = array_rand($all_files);

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 05:55 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0