You are here: Re: random without replacement « PHP Programming Language « IT news, forums, messages
Re: random without replacement

Posted by Tyxod on 11/18/21 11:42

The "shuffle" thing does the work but produces an array with 58
elements. And it works a lot faster than the recursive thing (it
matters if the function is used more than a few times in a script).

But if you need just 13 (or anything else <>58) items in the array the
recursive function is really the only sane way to go.

(of course one could "shuffle($randomstuff);" and then pick up the
first 13 items from the resulted array, but I really dont like doing
that)

 

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

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