English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The log() function returns the natural logarithm of a number.
log(num, base)
num-The value to calculate the logarithm for
Base-Logarithm Base
The log() function returns the natural logarithm of a number.
<?php echo(log(1)); ?>
Output Result
0
Let's look at another example-
<?php echo(log(0)); ?>
Output Result
-INF
Let's look at another example-
<?php echo(log(10)); echo(log(2.7)); ?>
Output Result
2.3025850929940.99325177301028