+ 3
How can i find a first largest value from array, the second largest value from array, and third largerst value from array
5 Antworten
+ 3
Arrange the array in descending order and pick index 0,1,2!!
+ 23
i was coming to say the same @Ayush 😂
+ 2
just loop over it and keep the first to third highest value
+ 1
sorry i newbie. thanks for help me !
0
<?php
$numbers=array(4,6,2,22,11);
sort($numbers);
echo $numbers;
?>
I think you can use rsort as well to reverse the order of the numbers
https://www.w3schools.com/php/func_array_sort.asp
http://php.net/manual/en/function.sort.php
Php.net/manual is a good resource for all things php and w3 schools is an all around good resource for almost everything
Hope it helps.