PHP Tutorial

A web server programming language.

PHP Math

PHP Math

PHP has a set of math functions that allows you to perform mathematical tasks on numbers.

Common Math Functions:

  • pi() - Returns PI
  • min() / max() - Find lowest/highest value
  • abs() - Absolute value
  • sqrt() - Square root
  • round() - Rounds a floating-point number
  • rand() - Generates a random number

Try It Yourself

Edit the code below and click Run to see the result live.

Source Code
Result
Topics