PHP tanh( ) Function Last Updated : 22 Jun, 2023 Comments Improve Suggest changes Like Article Like Report The tanh() function is a builtin function in PHP and is used to find the hyperbolic tangent of an angle passed to it as parameter. The hyperbolic tangent of any argument arg is defined as, sinh(arg) / cosh(arg) Where, sinh() is the hyperbolic sine function and cosh() is the hyperbolic cosine function. Syntax: float tanh($value) Parameters: This function accepts a single parameter $value. It is the number whose hyperbolic tangent value you want to find. The value of this parameter must be in radians. Return Value: It returns a floating point number which is the hyperbolic tangent value of a number passed to it as argument. Examples: Input : tanh(0.50) Output : 0.46211715726001 Input : tanh(-0.50) Output : -0.46211715726001 Input : tanh(5) Output : 0.9999092042626 Input : tanh(M_PI_4) Output : 0.65579420263267 Below programs, taking different values of $value are used to illustrate the tanh() function in PHP: Passing 0.50 as a parameter: PHP <?php echo (tanh(0.50)); ?> Output: 0.46211715726001 Passing -0.50 as a parameter: PHP <?php echo (tanh(-0.50)); ?> Output: -0.46211715726001 Passing 5 as a parameter: PHP <?php echo (tanh(5)); ?> Output: 0.9999092042626 When (M_PI_4) is passed as a parameter, M_PI is a constant in PHP whose value is 0.78539816339744830962 : PHP <?php echo (tanh(M_PI_4)); ?> Output: 0.65579420263267 Reference: http://php.net/manual/en/function.tanh.php Comment More infoAdvertise with us Next Article PHP tanh( ) Function S Shubrodeep Banerjee Follow Improve Article Tags : Misc Web Technologies PHP PHP-math Practice Tags : Misc Similar Reads PHP strlen() Function The strlen() is a built-in function in PHP which returns the length of a given string.It calculates the length of the string including all the whitespaces and special characters. Syntax:strlen($string);Parameters: This parameter represents the string whose length is needed to be returned. Return Val 1 min read PHP strval() Function The PHP strval() function converts a given variable to a string. It takes a scalar variable (like integers, floats, and booleans) and converts it to its string representation. For arrays, objects, and resources, it does not work and may produce unexpected results.Syntaxstrval( $variable ) Parameter: 3 min read PHP | time() Function The time() function is a built-in function in PHP which returns the current time measured in the number of seconds since the Unix Epoch. The number of seconds can be converted to the current date using date() function in PHP. Syntax: int time() Parameter: This function does not accepts any parameter 2 min read PHP trim() Function The trim() function in PHP is an inbuilt function which removes whitespaces and also the predefined characters from both sides of a string that is left and right. Related Functions: PHP | ltrim() Function PHP | rtrim() Function Syntax: trim($string, $charlist) Parameters:The function accepts one man 2 min read PHP String Functions Strings are a fundamental data type in PHP, used to store and manipulate text. PHP provides a wide variety of built-in string functions. These functions perform various operations such as string transformations, character manipulations, encoding and decoding, and formatting, making string handling s 6 min read Like