How can the deg2rad() function be utilized in PHP for trigonometric calculations?

When working with trigonometric calculations in PHP, it's important to convert angles from degrees to radians as most trigonometric functions in PHP (like sin(), cos(), tan(), etc.) expect angles in radians. The deg2rad() function in PHP can be used to easily convert angles from degrees to radians before performing trigonometric calculations.

// Convert angle from degrees to radians
$angle_degrees = 45;
$angle_radians = deg2rad($angle_degrees);

// Calculate sine of the angle in radians
$sine_value = sin($angle_radians);

// Output the result
echo "Sine of $angle_degrees degrees is: $sine_value";