Jump to content

[SOLVED] Two largest numbers in an array


Gibbs

Recommended Posts

I'm trying to find the two largest values in an array. The max function is great but I'm also looking for the second largest number... I can't use any sorting functions as the array name must stay the same. The sort functions I've tried, for example, will rename $array["TEST1"] to $array[0].

 

Any help appreciated. Thanks.

Link to comment
https://forums.phpfreaks.com/topic/75011-solved-two-largest-numbers-in-an-array/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.