PHP Programs

Please click on 1-2 Ads to keep this website's Study Material FREE and regularly Updated.

Program 7: Create a PHP program using functions for comparing three integers and print the largest number.

largest.php

<!DOCTYPE html>
<html>
<head>
	<title>PHP Progarms TutorialDuniya.com</title>
</head>
<body>
	<?php
		$num1=5;
		$num2=10;
		$num3=15;

		echo "<br> num1 =".$num1;
		echo "<br> num2 =".$num2;
		echo "<br> num3 =".$num3;

		$max = $num1;

		if ($num2>$max)
			$max=$num2;
		if ($num3>$max)
			$max=$num3;

		echo "<br> Maximum of three nos. is".$max;
	?>
</body>
</html>



If you have any suggestion or found any error in the above program, then do let us know at [email protected] or just comment below.