How to use log in PHP

This article describe about log() Function in PHP.
  • 1465

log() Function

This function returns the logarithm (base E ) of a number.

Syntax

log(x,base)

 

Parameter Description
x Specified a number.
base Optional. If the base parameter is specified, log() returns logbase x.

Note: If the value of x is negative then return -1.#IND.

Example

<html>
<?php
echo(log(3.718) . "<br />");
echo(log(2) . "<br />");
echo(log(1) . "<br />");
echo(log(0) . "<br />");
echo(log(-1))
?>
</html>

 

Output


logphp.jpg

You may also want to read these related articles Click here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.