How to Find Largest Number in Array Using PHP?

How to Expose and Route to a Resource?
How to Expose and Route to a Resource?

आज इस आर्टिकल में हम आपको 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";
?>

इसे भी पढ़े – How to Find Largest Value Between Three Value Using PHP?

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

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