Re: counting files, choosing at random
| From: | Peng Cheng | Date: | Wed, 13 Aug 2003 09:36:04 +0000 |
| Subject: | Re: counting files, choosing at random | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-159512@lists.php.net to get a copy of this message | ||
i think the problem is there is a newline between
the
"<img src="/szukaj/images/i" and
"<? ".
try write them in the same line may be a solution.
"Adam I Agnieszka Gasiorowski Fnord" <agquarx@venus.ci.uw.edu.pl>
??????:3F39FCE2.17F0BB02@venus.ci.uw.edu.pl...
>
> 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
>