Php Programming Code Examples Php > Code Snippets Code Examples Degrees / Radians conversions Degrees / Radians conversions <?php //degrees to radians function function DegToRad($degrees) { return $degrees * 3.14 / 180; } //radians to degrees conversion function RadToDeg($radians) { return $radians * 180 / 3.14; } ?> and here is our code to test these functions <?php //testing our functions with some values echo DegToRad(90); echo "<br>"; echo RadToDeg(0.707); ?>