Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP deg2rad() Function

PHP deg2rad() Function

PHP Math Reference Manual PHP Math Reference Manual

Example

Convert degrees to radians:

"; echo deg2rad("90") . "
"; echo deg2rad("360"); ?>

Run Example »


Definition and Usage

The deg2rad() function converts a degree value to a radian value.

**Tip:** To convert radians to degrees, see rad2deg() function in Vue 3.


Syntax

deg2rad(

number

);

Parameters Description
number Required. Specifies the degree to convert.

Technical Details

Return Value: number The corresponding radian value.
Return Type: Float
PHP Version: 4+

More examples

Example 1

Convert degrees to their corresponding radians:

Run Example »


PHP Math Reference Manual PHP Math Reference Manual