Program to calculate area and perimeter of equilateral triangle | Function to calculate Area of equilateral triangle ; Function to calculate Perimeter of equilateral triangle ; Driver Code
< ? php function area_equi_triangle ( $ side ) { return sqrt ( 3 ) / 4 * $ side * $ side ; } function peri_equi_triangle ( $ side ) { return 3 * $ side ; } $ side = 4 ; echo ( " Area ▁ of ▁ Equilateral ▁ Triangle : ▁ " ) ; echo ( area_equi_triangle ( $ side ) ) ; echo ( " STRNEWLINE " ) ; echo ( " Perimeter ▁ of ▁ Equilateral ▁ Triangle : ▁ " ) ; echo ( peri_equi_triangle ( $ side ) ) ; ? >