deg2rad()
deg2rad() — Converts the number in degrees to the radian equivalent.
Built-in function of PHP 8.5. The manual lists it as available in PHP 4, PHP 5, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.
Signature
deg2rad(float $num): float
Parameters
| Parameter | Type | What it takes |
|---|---|---|
| $num | float | Angular value in degrees |
Return value
The radian equivalent of num
Example
A runnable snippet:
echo deg2rad(45), PHP_EOL; // 0.785398163397 var_dump(deg2rad(45) === M_PI_4); // bool(true)
See also
All PHP 8.5 built-in functions
Reference card built from the PHP manual page deg2rad() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.