cosh()

Published Jun 21, 2023
Contribute to Docs

The cosh() function in PHP returns the hyperbolic cosine of a number. It calculates the value using the exponential function and is useful in various mathematical calculations.

Syntax

$result = cosh(number);

number: Represents the input value for which the hyperbolic cosine will be returned.

Example

In the following example the cosh() is used to return the hyperbolic cosine of 2.5:

<?php
echo(cosh(2.5));
?>

The output will be:

6.1322894796637

All contributors

Looking to contribute?

Learn PHP on Codecademy