Re: Array difficulty

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At this point, $result would be equal to "uppercase".  I feel like
this is a really kludgey way to accomplish this.  Is there a better way?
Not tested it, but max() should work as the first parameter can be an
array:
http://uk3.php.net/max

Except he's looking for the key and not the value, which max() would return. Come to think of it, the solution I provided does the same thing.

Untested but one of the below should work:

arsort($chance);
$lastItem = key( $chance[( count( $chance ) - 1 )]);

OR

arsort($chance);
$lastItem = key( end( $chance ));

thnx,
Chris
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux