Re: [PHP] pick a card, any card...

2011-04-10 Thread Richard Quadling
On 9 April 2011 15:43, Curtis Maurand wrote: > > > Curtis Maurand wrote: >> >> >> >> seems to > me that you have an array with integers as the keys. >> >> > $desired_key = rand(0, count($array)); > > sorry, I hadn't had > coffee, yet.  The line above should be: > > $desired_key = rand(0, count($ar

Re: [PHP] pick a card, any card...

2011-04-09 Thread Curtis Maurand
Curtis Maurand wrote: > > > > seems to me that you have an array with integers as the keys. > > $desired_key = rand(0, count($array)); sorry, I hadn't had coffee, yet.  The line above should be: $desired_key = rand(0, count($array) - 1); > > $desired_value => $array[$desired_key]; > > Ch

Re: [PHP] pick a card, any card...

2011-04-09 Thread Curtis Maurand
seems to me that you have an array with integers as the keys. $desired_key = rand(0, count($array)); $desired_value = $array[$desired_key]; Cheers, Curtis Simon J Welsh wrote: > On 9/04/2011, at 3:39 PM, Scotty Logan wrote: > >> On Apr 8, 2011, at 8:20 PM, Kirk Bailey wrote: >>> in otherwo

Re: [PHP] pick a card, any card...

2011-04-09 Thread Simon J Welsh
On 9/04/2011, at 3:39 PM, Scotty Logan wrote: > 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

Re: [PHP] pick a card, any card...

2011-04-08 Thread Scotty Logan
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 a

[PHP] pick a card, any card...

2011-04-08 Thread Kirk Bailey
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, n