counting files, choosing at random
| From: | Adam i Agnieszka Gasiorowski FNORD | Date: | Wed, 13 Aug 2003 08:54:58 +0000 |
| Subject: | counting files, choosing at random | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-159411@lists.php.net to get a copy of this message | ||
I want to choose a file at random from a
directory which adheres to certain naming scheme.
I can't get it to work. It's probably something
simple...Here is a relevant snippet:
<img src="/szukaj/images/i
<?
chdir('./szukaj/images/');
echo mt_rand(0, count(glob('i*.gif', GLOB_NOSORT)) - 1);
?>
.gif" width="120" height="151" alt=""
title="PropaGanda" border="0" />
(the files are all called i??.gif and
located in a directory /images/, which is a
subdirectory of directory where the script
is located (/szukaj/)).
Can you help?
--
Seks, seksić, seksolatki... news:pl.soc.seks.moderowana
http://hyperreal.info / ALinkA / bOrk! * WiNoNa ) (
http://szatanowskie-ladacznice.0-700.pl
foReVeR( * )
Poznaj jej zwiewne kształty... http://www.opera.com 007