Reply to Re: random without replacement

Your name:

Reply:


Posted by Geoff Berrow on 03/19/06 03:49

Message-ID: <qFRRf.6343$JZ1.201628@news.xtra.co.nz> from windandwaves
contained the following:

>
>I want a random list of numbers between 0 and 58 where each number can only
>occur once. I have written this ($f is an array):
>
>for($i = 0; $i < 13; $i++) {
> $rand[$i] = mt_rand(0,count($f));
>}
>
>what else do I need?

Here is my lottery ball picker

<?php
asort($rand_keys = array_rand(array_fill(1, 49,''), 6));
print "Your Lotto Numbers are: <big>".implode($rand_keys,", ")."</big>";
?>

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/

[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

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