Find the Diameter or Longest chord of a Circle | Function to find the longest chord ; Get the radius ; Find the diameter
< ? php function diameter ( $ r ) { echo " The ▁ length ▁ of ▁ the ▁ longest ▁ chord " , " ▁ or ▁ diameter ▁ of ▁ the ▁ circle ▁ is ▁ " , 2 * $ r << " STRNEWLINE " ; } $ r = 4 ; diameter ( $ r ) ; ? >