How to do max ( $myarray [*][2] );

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
liderbug
Forum Newbie
Posts: 19
Joined: Tue Jul 23, 2002 2:18 pm

How to do max ( $myarray [*][2] );

Post by liderbug »

Without doing a loop how do you get the max value of column 2 of a multidim array?

Tks
Chuck
User avatar
mydimension
Moderator
Posts: 531
Joined: Tue Apr 23, 2002 6:00 pm
Location: Lowell, MA USA
Contact:

Post by mydimension »

this topic has more relevance in the PHP forum. so i have moved it there.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

You could do a sort in reverse order (http://www.php.net/manual/en/function.rsort.php) and then grab the top element.

Mac
Post Reply