note 52723 added to function.array-rand
| From: | f00li5h at pin21 dot com | Date: | Wed, 11 May 2005 00:21:42 +0000 |
| Subject: | note 52723 added to function.array-rand | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-89236@lists.php.net to get a copy of this message | ||
red plus php minus spam at t vynce d dot t net
the array_rand function will randomly sort your array, so if you do
$rand = array_rand($magic_words);
print $rand[0];
will spit out a random magic word.
----
Manual Page -- http://www.php.net/manual/en/function.array-rand.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52723
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52723&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52723&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52723&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52723&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52723&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52723&report=yes
Search -- http://master.php.net/manage/user-notes.php