Like Us Like Us Facebook Subscribe Subscribe us YouTube Whatsapp Share us Whatsapp Query Send your queries

PHP Find Area of a Circle Using Constant

PHP Find Area of a Circle Using Constant

In this tutorial I am going to show , how to find area of a circle using PHP , In this tutorial we learn how to use PHP Constant.

Formula for Calculation Area of circle :

A=πr² , where A=area, π(Pie)=3.14 and r=radius

Script / Code to to calculate area of a circle

<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<title>PHP Find Area of a Circle Using Constant</title>

//area = pie * radius * radius
$area= PI * $radius * $radius;

echo "Area of the Circle is ".$area;
<h2>Area of a Triangle</h2>
<form action="" method="post">
<b>Enter Radius</b><br/>
<input type="text" name="radius" ><br/>
<input type="submit" name="submit" value="Submit">