PHP program to enter the length and breadth of a rectangle and find its area
ADVERTISEMENTS
PHP program to enter the length and breadth of a rectangle and find its area.
There are you will learn how to find the area of a rectangle in PHP language.
Formula:
P = l * w
where:
P
= perimeter
l
= length of the rectangle
w
= width of the rectangle
Let us understand this through the PHP program:
<?php
// PHP program to find the area of a rectangle
$l = 5;
$w = 7;
$a = NULL;
// Calculate area of rectangle
$a = $l * $w;
echo "\nArea of rectangle = " . $a . " units";
?>
Output:
Area of rectangle = 35 units