PHP tanh() Function

❮ PHP Math Reference

Example

Return the hyperbolic tangent of different numbers:

<?php
echo(tanh(M_PI_4) . "<br>");
echo(tanh(0.50) . "<br>");
echo(tanh(-0.50) . "<br>");
echo(tanh(5) . "<br>");
echo(tanh(10) . "<br>");
echo(tanh(-5) . "<br>");
echo(tanh(-10));
?>
Try it Yourself »

Definition and Usage

The tanh() function returns the hyperbolic tangent of a number, which is equal to sinh(x)/cosh(x).


Syntax

tanh(number);

Parameter Values

Parameter Description
number Required. Specifies a number

Technical Details

Return Value: The hyperbolic tangent of number
Return Type: Float
PHP Version: 4.1+

❮ PHP Math Reference
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.