← All built-ins / log()
log()
log(mixed $number): float
Parameters
| Name | Type | Description |
|---|---|---|
| $number | float|int | positive input |
| $base | float|int | logarithm base (default e)optional |
Return value
Natural logarithm, or base-$base logarithm.
Example
echo round(log(M_E), 3), " ", round(log(8, 2), 4);
1 3