PHP tanh()
Published Jun 21, 2023
Contribute to Docs
The tanh() function in PHP is a mathematical function that returns the hyperbolic tangent of a number. It calculates the ratio of the hyperbolic sine to the hyperbolic cosine of the input value.
Syntax
$result = tanh($number);
$number: The input value for which the hyperbolic tangent will be returned.
Example
In the following example the tanh() function is used to print the tanh of 10:
<?phpecho(tanh(10));?>
The output will be:
0.99999999587769
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.
Learn PHP on Codecademy
- Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
- Includes 6 Courses
- With Professional Certification
- Beginner Friendly.75 hours