PHP TutorialLesson 12Free preview
PHP Math
This lesson is part of PHP · All levels
Summary
PHP has many built-in mathematical functions that facilitate calculations, ranging from absolute values, square roots, rank, to random numbers. This lesson introduces these functions and examples of their use. By using the built-in function, you don't have to write the formula from scratch.
Key points
- Find the absolute value, and find the greatest/minus
- Calculate the square root, calculate the rank
- Round it up, round it down
- Rand() generates random numbers within a given range
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.