Facebook Page Twitter Page LinkedIn Page
× PHP Tutorial PHP Advanced PHP Resources


The PHP Math tanh() function returns hyperbolic tangent of a value. The hyperbolic tangent of x is defined as:

tanh

where e is an Euler's number.

Syntax

tanh(number)

Parameters

number Required. Specify the value.

Return Value

Returns the hyperbolic tangent of a value.

Example:

In the below example, tanh() function is used to find out the hyperbolic tangent of a value.

<?php
echo tanh(0)."\n";
echo tanh(2)."\n";
echo tanh(4)."\n";
?>

The output of the above code will be:

0
0.96402758007582
0.99932929973907

❮ PHP Math Functions