Justtechjobs.com Find a programming school near you






Online Campus Both


php4-beta | 200004

Re: [PHP4BETA] array_rand() feedback From: Andrei Zmievski (andrei <email protected>)
Date: 04/29/00

On Sat, 29 Apr 2000, Sterling Hughes wrote:
> I think it would be a good idea to just return keys, not key-value
> pairs, since its simple enough to do:
>
> $key = array_rand($ar);
> echo $ar[$key]; // value (duh)
>
> I also like the second argument idea, again I think it should be
> something like:
>
> list ($key1, $key2, $key3) = array_rand($ar, 3);

Good idea, I'll implement it.

-Andrei

Computer, if you don't open that exit hatch this moment I shall zap straight
off to your major data banks and reprogram you with a very large axe.
-- Douglas Adams / The Hitchhiker's Guide to the Galaxy

-- 
PHP 4.0 Beta Mailing List <http://www.php.net/version4/>
To unsubscribe, e-mail: php4beta-unsubscribe <email protected>
For additional commands, e-mail: php4beta-help <email protected>
To contact the list administrators, e-mail: php4beta-admin <email protected>