find largest element of an array in php
<?php
$array = array(5,7,81,0,12);
$max1 =0 ;
$max2 = 0;
for($i=0; $i $max1)
{
$max2 = $max1;
$max1 = $array[$i];
}
else if($array[$i] > $max2)
{
$max2 = $array[$i];
}
}
echo "Maximum value = ".$max1;
echo "
";
echo "Second maximum Value =".$max2;
?>
Also in PHP:
- array reverse sequence pp
- config cache clear in laravel
- cache clear laravel command
- create project with laravel 7
- In PackageManifest.php line 131: Undefined index: name laravel 7
- composer in laravel
- Upload image laravel 6
- Allowed memory size of 2147483648 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0
- data validation of $_POST in php
- check length of string in php
- can php date be echoed as string
- CONTAIN PHP
- Modularizing laravel 8.0
- codeigniter 4 query builder select
- append new line php
- Date - hours php
- date time to date php
- display rounded price get_price php
- angular post phph
- $time = date('r') php
- clear laragon cache
- PHP Warning: Module 'soap' already loaded in Unknown on line 0
- add days to date in php
- PHP extension ext-dom