Program to find the Perimeter of a Regular Polygon | Function to calculate the perimeter ; Calculate Perimeter ; Get the number of sides ; Get the length of side ; find perimeter
< ? php function Perimeter ( $ s , $ n ) { $ perimeter = 1 ; $ perimeter = $ n * $ s ; return $ perimeter ; } $ n = 5 ; $ s = 2.5 ; $ peri = Perimeter ( $ s , $ n ) ; echo " Perimeter ▁ of ▁ Regular ▁ Polygon " , " ▁ with ▁ " , $ n , " ▁ sides ▁ of ▁ length ▁ " , $ s , " ▁ = ▁ " , $ peri ; ? >