PHP log10() Function
Definition
The log10() function returns the base-10 logarithm of a number.
Syntax
PHP log10() Function has the following syntax.
log10(number);
Parameter
Parameter | Is Required | Description |
---|---|---|
number | Required. | Value to calculate the logarithm for |
Return
Item | Description |
---|---|
Return Value | The base-10 logarithm of number |
Return Type | Float |
Example
Return the base-10 logarithm of different numbers:
<?php//from ww w. j a va2s. co m
echo(log10(2.7183) . "\n");
echo(log10(2) . "\n");
echo(log10(10) . "\n");
echo(log10(0));
?>
The code above generates the following result.