5+ PHP Programs to Calculate Area of a Circle

This post contains a total of 5+ PHP Program Examples with Source Code to Calculate the Area of a Circle. All these Circle Area Calculator programs are made using PHP.

You can use the source code of these examples with credits to the original owner.

Related Posts

PHP Programs to Calculate Area of Circle

1. By Devangi Vaghasiya

Made by Devangi Vaghasiya. Php code to calculate area of circle. Source

Radius is = 50
Area of circle is =7850
<?php
     class circleshape 
{    
      function circleArea($radius)
    {
         echo "Radius is = $radius";
         echo "<br>Area of circle is =". (3.14*$radius*$radius);
    }
}
$ca=new circleshape ();
$ca-> circleArea (50);
?>

2. By Malek Alsset

Made by Malek Alsset. Simple program to find area of a circle. Source

11
Area is 380.182
<?php 
function findArea( $r) 
{ 
    $PI =3.142; 
    return $PI * pow($r, 2); 
} 
   
echo("Area is "); 
echo(findArea(11)); 
return 0; 
?>    

3. By Ahmed algaym Haroon Ali Ahmed

Made by Ahmed algaym Haroon Ali Ahmed. Basic Circle area calculator program. Source

12
Area of circle=452.16
<?php

$radius=12;
$area=(3.14)*$radius*$radius;
echo "Area of circle=".$area;
   
?>

4. By Hardik Deshmukh

Made by Hardik Deshmukh. Program to Calculate areas of multiple Circle. Source

Circle 1 radius is 2
Circle 2 radius is 3
Circle 1 Area is 12.56
Circle 2 Area is 28.26
Addition of both the circle's area is 40.82
<?php
$rad1=2;
$rad2=3;
echo"Circle 1 radius is $rad1<br>";
echo"Circle 2 radius is $rad2<br>";
function area($rad)
  {
     $z= 3.14*$rad*$rad;
     return $z;
     
  }
$a1=area($rad1);
echo "Circle 1 Area is $a1<br>";
$a2=area($rad2);
echo "Circle 2 Area is $a2<br>";
$sum=$a1+$a2;
 echo "Addition of both the circle's area is $sum";


?>

5. By Suchita Jadhav

Made by Suchita Jadhav. Source

2
Area of circle=12.56
<?php
$radius=2;
$pi=3.14;
$side=4;
$lenght=3;
$breadth=4;

$area1=$pi*$radius*$radius;

echo"Area of circle=$area1";
?>

6. By Sritika Manjrekar

Made by Sritika Manjrekar. Php program to find diameter, circumference and area of circle. Source

Diameter of the circle is 20units 
Circumference of the Circle is 62.8units 
Area of the Circle is 314 sq. units
<?php

$radius=10;
$pi=3.14;

echo "Diameter of the circle is ",(2*$radius),"units\n";

echo "Circumference of the Circle is ",(2*$pi*$radius),"units\n";

echo "Area of the Circle is ",($pi*$radius*$radius)," sq. units";

?>