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