Re: Re: Determine variable with the lowest value?
| From: | Greg Donald | Date: | Thu, 14 Oct 2004 16:53:12 +0000 |
| Subject: | Re: Re: Determine variable with the lowest value? | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-199493@lists.php.net to get a copy of this message | ||
On Thu, 14 Oct 2004 10:52:20 -0500, BOOT <pfine@of-law.com> wrote:
> OK thanks but I guess I didn't explain what I am trying to do properly.
>
> I need to be able to identify the variable name as well as pick the variable
> with the lowest value.
>
> Something like this:
>
> Whose turn is it to take out the garbage?
>
> Mike has done it 3 times
> Bob has done it 2 times
> Jane has done it 5 times
> etc...
>
> Therefore its Bob's turn.....
$a = array(3 => 'Mike', 2 => 'Bob', 5 => 'Jane');
sort($a);
echo $a[0];
--
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/