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