Re: pick a card, any card...
| From: | Scotty Logan | Date: | Sat, 09 Apr 2011 03:39:52 +0000 |
| Subject: | Re: pick a card, any card... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-312316@lists.php.net to get a copy of this message | ||
On Apr 8, 2011, at 8:20 PM, Kirk Bailey wrote:
> in otherwords, the entire idea of picking one of N objects, whatever they are- strings,
> numbers, gummybears, lined up in a listing, and return the one item selected. This seems a common
> enough function there should be a simple way to do it already in php. HOWEVER, I ain't
> findin' it that way, no sir/maam/other.
> Maybe I am missing the obvious SIMPLE way to get the job done. So if we have a listing of
> foo's, we can title this $listing, and we want 1 of them to be returned, we should see
> something like:
> randmember($listing)
array_rand() - it's already built-in - http://php.net/manual/en/function.array-rand.php
Scotty