Reply to Re: Select random files out of a directory

Your name:

Reply:


Posted by Hendri Kurniawan on 01/05/07 05:28

Unless other people knows any other methods.

for($i = 0; $i < 1024; $i++) $fileName = readdir($dirHandler);
print $fileName;

Now if you know the file names, that is another matter.

Hendri Kurniawan

howa wrote:
> Hendri Kurniawan 寫道:
>
>> Yes...
>> See opendir, readdir, rand
>> And get creative
>>
>> Hendri Kurniawan
>>
>>
>> howa wrote:
>>> for example, there are 10K files in the directory,
>>>
>>> given that i don't know if files name, is it possible to fetch a file
>>> randomly?
>>>
>>> thanks.
>>>
>
> the problem is:
>
> there are too many files in the folder, e.g. over 10K or more, i don't
> want to list it
>
> but i know that it must contains 10K files, so it is possible to get ,
> say 1020th file under this folder?
>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация