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

ParameterIs Required Description
numberRequired.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.





















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions