Click here to Skip to main content
15,914,255 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
this is my array and i have to find max and min value of it please help

$array=array(
array("Hassan"=>1100),
array("Mammad"=>600),
array("Jonathan"=>1200),
array("Livinstone"=>900),
array("Habibulina"=>1400),
array("Hoseingulu"=>950)
);


What I have tried:

I tries to use min() and max() methods but it didnot work
Posted
Updated 10-Mar-17 11:27am
Comments
Richard MacCutchan 10-Mar-17 10:29am    
"but it didnot work"
Then it is most likely that your code is wrong. However, since we cannot see your code it is impossible to make any suggestions.
Member 12937928 10-Mar-17 10:37am    
I just want to find max and min value from that array
Richard MacCutchan 10-Mar-17 10:39am    
See my comment above.

 
Share this answer
 
I think you can write the code to loop the array, extract the name and number and store all of them together on a temporary array. After that, use the array_search function to find the min and max of the numbers.

How do I find max and min value in multidimentional associativ array?[^]

Output:
Max: Habibulina - 1400
Min: Mammad - 600
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900