 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
log() function in PHP
The log() function Returns the natural logarithm of a number.
Syntax
log(num, base)
Parameters
- num − The value for which you want to calculate the logarithm 
- base − The logarithmic base 
Return
The log() function Returns the natural logarithm of a number.
Example
<?php echo(log(1)); ?>
Output
0
Example
Let us see another example −
<?php echo(log(0)); ?>
Output
-INF
Example
Let us see another example −
<?php echo(log(10)); echo(log(2.7)); ?>
Output
2.3025850929940.99325177301028
Advertisements
 