PHP log10() Function

Definition and Usage

log10() is the logarithm to the base 10.

Syntax

log10(x)
Parameter Description
x Required. A number.

Description

Returns the parameter x Logarithm to the base 10.

Tips and Comments:

Note:If the parameter x is negative, it returns -1.#IND.

Example

In this example, we apply the log10() function to different numbers:

<?php
echo(log10(2.7183));
echo(log10(2));
echo(log10(1));
echo(log10(0));
echo(log10(-1));
?>

Output similar to:

0.434297385125
0.301029995664
0
-1.#INF
-1.#IND