You are here: Re: Not generating the same random number twice.... « PHP Programming Language « IT news, forums, messages
Re: Not generating the same random number twice....

Posted by Shelly on 06/14/05 03:04

<chernyshevsky@hotmail.com> wrote in message
news:1118693141.851760.37230@z14g2000cwz.googlegroups.com...
> I'm just guessing that the script involves paging through a list of
> fifty images, five at a time. If that's case you'd need to have the
> same array as you go from page to page. Otherwise then, yes, as you
> said, you can just pop 5 numbers off the array.
>
> Another way to maintain the same randomized array across pages is to
> seed the random number engine with a fixed number, like today's date. A
> useful trick when you don't want to use session.
>

Isn't this doing double work? The shuffle randomizes the array. Then, all
you need to do is take the first five elements, since they are already in
random order. -- or am I missing something?

Shelly

 

Navigation:

[Reply to this 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

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