PHP in HindiProgramming Language

How to Find Largest Number in Array Using PHP?

Problem:- How to Find Largest Number in Array Using PHP?,  PHP Get Highest Value from Array, Find Largest Number in Array, Get Highest number from array using for loop, Finding largest numbers in array

Solution – Find Largest Number in Array Using PHP Without Function

<?php
$num = array(100, 30, 15, 60, 45, 80, 90, 50);
$a = $num[1];
for($i = 0; $i<count($num); $i++){
	if($num[$i]>$a){
		$a = $num[$i];
	}
}
echo "$a is largest";
?>

 

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button
Close