note 23604 added to function.array-rand

From: Date: Tue, 23 Jul 2002 15:21:09 +0000
Subject: note 23604 added to function.array-rand
Groups: php.notes 
Request: Send a blank email to php-notes+get-33431@lists.php.net to get a copy of this message
Re: >lordwolf[at]homewolf[dot]com >09-May-2002 02:23 >Confirmed... >I can only get array_rand() to work if the second arg is >= 2. If the second arg is 1, the function returns a variable instead of an array. I suppose there was a reason for this, but I found it rather confusing and annoying... So the function does work, but just not in the way you'd assume. I should imagine you'd be able to sort yourself out with is_array() etc... -- http://www.php.net/manual/en/function.array-rand.php http://master.php.net/manage/user-notes.php?action=edit+23604 http://master.php.net/manage/user-notes.php?action=delete+23604 http://master.php.net/manage/user-notes.php?action=reject+23604

« previous php.notes (#33431) next »