The PHP math functions are used to handle values within the range of integer and float types. In this article I describe some more of the PHP math functions. Here I explain some Math functions and I also describe some Math functions in Part1 and Part2.
PHP Rand() function
The PHP rand function generates a random integer. If you call rand without a parameter then it will return a random integer between 0 and RAND_MAX.
Syntax
| rand (min, max) |
Parameters in Rand function
It has two parameters; they are:
| Parameter | Description |
| min | It specifies minimum range as a integer. |
| max | It specifies maximum range as a integer. |
Example of Rand function
<?php
echo ("Random number without the range: ". rand() ."</br>");
echo ("Random number between 10 to 100: ".rand(10,100)."</br>");
?>
Output
PHP Round() function
It rounds a number to the nearest integer.
Syntax
| round (number, round decimal) |
Parameters in Round function
It has two parameters; they are:
| Parameter | Description |
| number | The no to be round and it is required parameter. |
| round decimal | It is optional parameter and specifies number of digests after the decimal point. |


Gowtham RajamanickamPosted Apr 11, 2015, 1:40 PM
good one