find largest element of an array in php

Solutions on MaxInterview for find largest element of an array in php by the best coders in the world

showing results for - "find largest element of an array in php"
Jenna
26 Jan 2020
1<?php 
2$array = array(5,7,81,0,12);
3
4$max1 =0 ;
5$max2 = 0;
6
7for($i=0; $i $max1)
8    {
9      $max2 = $max1;
10      $max1 = $array[$i];
11    }
12    else if($array[$i] > $max2)
13    {
14      $max2 = $array[$i];
15    }
16}
17echo "Maximum value = ".$max1;
18echo "
19"; 
20echo "Second maximum Value =".$max2;
21?> 
22
queries leading to this page
write php program for finding the largest and smallest element in an array of 10 elementsarray php get biggest valuehow to find largest value in asscociative array and get its key in phpfind largest number in array php without functionphp highest number arrayget highest value from array phphighest value in array phphow to find maximum value in array phpphp array find highest valuephp bigger numberget largest number in array phpphp get max value from arrayreturn biggest value of an array in phphow to find the largest value in array phpfind largest number in indexed array php without functionarray max value phpphp get highest value in arrayphp get the max value in arrayphp maxfind the largest value in an array phpfind largest number in array php functionget highest value in array phpsecond largest number in array phpphp highest value in arrayphp get max of numbers representing stringsget largest value from a array phphow to find maximum number in array phpphp array get biggest numbersecond largest element in array in phpbiggest number in array phphow to get maximum value in array in phpget highest number in array phpfind largest number in all inner array in phpphp get max discount value arayphp get biggest value from arrayphp find max from 2 valuephp array get largest valueget largest array php lengthfind the 2 largest elements in the array phpfind maximum number in array phpget the largest number in array phpget max value in array phpphp highest number in arrayget the largest value from the array phpphp find largest number in arrayphp get maxphp find highest value in arrayarray find the highest value phpphp get max value in arrayphp find max valiue in array by valuephp max element of arraylargest number in array in phphow to find biggest number in array phpfind biggest in an array in phpphp find largest numberphp select maxget biggest number from array phpphp max 28array max phpget biggest and smallest value from array inside an array phparray max value in phparray max phpfind highest value in an array phpphp get max value of arrayget max value from array phpmax array phpphp biggest number in arrayhow can be find the highest element from the array in phphighest value of array phpfind largest element of an array in phpmax from array phphighest number in array phpwrite php program for finding the largest and smallest element in an array of 10 elements in phpphp max top 10 find highest value in array phphow to get the maximum value in an array in phphow to get largest number in array php without in functionhow to find maximum value from an array phpget biggest value from array phphow to finad a largest number in an array in phpphp get highest number in arrayhow to get largest number in array phphow to find the biggest array value in phpmax in array in phpphp get the highest value in arrayhow to find the largest numbers in an array in phpbiggest number in array without array function in phpphp array max valuefind largest number in phpget the highest value in an array phplist max five value amount list find phphow to find largest number in phphow to get max value in php variablehighest element in array phpfind largest number in array in phpmax number phpget largest value from php arrayget the greatest number array phpphp array maxget greater value from 0 in phpget largest array phpphp get the biggest in the arrayget largest array length inside array phpphp find biggest number in arrayhow to find maximum value of a array in phpphp get largest value in arrayhow to get the highest value in an array phphow to find largest number from array in php find maximum number in phpphp select largest number from arrayphp program to read array of numbers from database and find the largestphp function max valueget highest value in arrayfunction find largest 28array 24numbers 29 phpmax phpfind largest number in array phpfind biggest in array phpfind largest number in array of array in phpphp find the highest value in an arrayphp find max value in arrayfind max number in array in phpfinding the largest number in an array in phpphp get biggeest numberphp return largest numberget biggest number in array phpphp max 28 29how to get biggest and smallest value from an array in phpget the max value in array phpmax in array phpcheck if value is highest value of all phpphp getting largest value from an arrayphp max functionhow to find highest number in array in phpphp get bigger numberget the highest value in array phpmax 28 29 syntax in php5 highest number in an array phpfind multiple greatest number in phpget max two numbers of array phphow to get maximum value in phpphp get biggest number in arrayphp print max and mixfind largest element of an array in php