note 54460 deleted from function.shuffle by danbrown
| From: | danbrown@php.net | Date: | Fri, 25 Jul 2008 17:46:32 +0000 |
| Subject: | note 54460 deleted from function.shuffle by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-142717@lists.php.net to get a copy of this message | ||
Note Submitter: anders dot carlsson at sfks dot se
----
Vladimir's routine to sort an associated array is great, but one may want to add a clause to
check that the array is not empty:
if (count($shuffle_me)>0) { code }
This is because array_rand does not like to pick zero entries out of an empty array (at least not in
PHP 4.x).