THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

PHP log10() Function

PHP Math Reference PHP Math Reference

Example

Return the base-10 logarithm of different numbers:

<?php
echo(log10(2.7183) . "<br>");
echo(log10(2) . "<br>");
echo(log10(1) . "<br>");
echo(log10(0));
?>
Run example »

Definition and Usage

The log10() function returns the base-10 logarithm of a number.

Syntax

log10(number);

Parameter Description
number Required. Specifies the value to calculate the logarithm for

Technical Details

Return Value: The base-10 logarithm of number
Return Type: Float
PHP Version: 4+

PHP Math Reference PHP Math Reference