Programming Code Examples

How to calculate perimeter and area of a rectangle in PHP1 min read

Perimeter: The perimeter is the length of the outline of a shape. To find the perimeter of a rectangle or square you have to add the lengths of all the four sides. x is in this case the length of the rectangle while y is the width of the rectangle.

Area: The area is measurement of the surface of a shape. To find the area of a rectangle or a square you need to multiply the length and the width of a rectangle or a square.



PHP Code:


Add comment