Today, we will discuss the rad2deg() function in PHP. This function is used to convert radians to degrees.

What is the rad2deg() Function?

The rad2deg() function in PHP is a built-in function that is used to convert radians to degrees. Radians are a unit of measurement for angles, while degrees are another unit of measurement for angles. One radian is equal to 180/π degrees, or approximately 57.295779513082 degrees.

How to Use the rad2deg() Function

Using the rad2deg() function in PHP is very simple. Here is an example of how to use the function:

// Convert radians to degrees using the rad2deg() function
$result = rad2deg(1.047);

// Output the result
echo $result;

In this example, we call the rad2deg() function to convert the angle of 1.047 radians to degrees. We then store the result in a variable and output it to the screen.


The rad2deg() function in PHP is a useful tool for any PHP developer working with angles. By using this function, you can easily convert radians to degrees, which can be useful in a variety of applications. We hope that this guide has been helpful in understanding how to use the rad2deg() function in your PHP code.

Practice Your Knowledge

What does the rad2deg() function in PHP do?

Quiz Time: Test Your Skills!

Ready to challenge what you've learned? Dive into our interactive quizzes for a deeper understanding and a fun way to reinforce your knowledge.

Do you find this helpful?