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 PHP | Functions A function in PHP is a self-contained block of code that performs a specific task. It can accept inputs (parameters), execute a set of statements, and optionally return a value. PHP functions allow code reusability by encapsulating a block of code to perform specific tasks.Functions can accept param 8 min read PHP | ob_start() Function Let's take a quick recap. PHP is an interpreted language thus each statement is executed one after another, therefore PHP tends to send HTML to browsers in chunks thus reducing performance. Using output buffering the generated HTML gets stored in a buffer or a string variable and is sent to the buff 2 min read PHP pos() Function The pos() is an inbuilt function in PHP which is used to return the value of the element in an array which the internal pointer is currently pointing to. The pos() function does not increment or decrement the internal pointer after returning the value. In PHP all arrays have an internal pointer. Thi 2 min read PHP strnatcmp() function The strnatcmp() is a built-in function on PHP. This function compares two strings using a "natural order" algorithm and return a positive integer, negative or zero. This function is case-sensitive. Syntax: strnatcmp( $string1, $string2 ) Parameters: The functions accepts two mandatory string paramet 2 min read PHP | print_r() Function The print_r() function is a built-in function in PHP and is used to print or display information stored in a variable. Syntax: print_r( $variable, $isStore ) Parameters: This function accepts two parameters as shown in above syntax and described below. $variable: This parameter specifies the variabl 2 min read Like