The tanh() function returns the hyperbolic tangent of the specified value.Syntaxtanh(val)Parametersval − A value in radiansReturnThe tanh() function returns the hyperbolic tangent of the specified value val.ExampleThe following is an example to get the hyperbolic tangent of 0 and 1: Live DemoOutput00.76159415595576ExampleLet us see an example to get the hyperbolic tangent of constant M_PI_4 − Live DemoOutput0.65579420263267ExampleLet us see an example to get the hyperbolic tangent of values 0.50 and -0.50 − Live DemoOutput0.46211715726001-0.46211715726001ExampleLet us see another example to get the hyperbolic tangent of negative values − Live DemoOutput-0.9999092042626-0.99999999587769
The tan() function returns the tangent of the specified value.Syntaxtan(val)Parametersval − A value in radiansReturnThe tan() function returns the tangent of the specified value val.Example Live DemoOutput01.5574077246549ExampleLet us see another example − Live DemoOutput1ExampleLet us see another example − Live DemoOutput0.54630248984379-0.54630248984379ExampleLet us see another example − Live DemoOutput3.3805150062466-0.64836082745909
The mt_srand() function seeds the random number generator.Note − Random number generator is seeded automatically after the release of PHP 4.2.0. This function is not needed now.Syntaxsrand(seed)Parametersseed − The seed valueReturnThe srand() function Returns nothing.Example Live DemoOutput664617053ExampleLet us see another example − Live DemoOutput4
The sqrt() function Returns the square root of a number.Syntaxsqrt(num)Parametersnum − The number for which you want to find the square rootReturnThe sqrt() function Returns the square root of the specified number.Example Live DemoOutput4ExampleLet us see another example − Live DemoOutput0.5ExampleLet us see another example − Live DemoOutputNAN
The sinh() function Returns the hyperbolic sine of a number equivalent to.(exp(num) - exp(-num))/2)Syntaxsinh(num)Parametersnum − The number for which you want to Return the hyperbolic sine. A value in radians.ReturnThe sinh() function Returns the hyperbolic sine of a number.Example Live DemoOutput01.1752011936438ExampleLet us see another example − Live DemoOutput11.5487393572582.3012989023073
The zip_read() function reads the next entry in a ZIP file archive.Syntaxzip_read(zip)Parameterszip − The zip resource to readReturnThe zip_read() function returns a resource containing a file within the zip archive on success.ExampleThe following is an example, wherein we have a zip file "new.zip", with the following files.amit.txt peter.txt result.html demo.java settings.iniExampleLet us now see the example:OutputFile Name = amit.txt File Name = peter.txt File Name = result.html File Name = demo.java File Name = settings.ini
For text transformation in CSS, use the text-transform property with the following values −text-transform: none|capitalize|uppercase|lowercase|initial|inherit;Example Live Demo div { line-height: 1.9; text-transform: uppercase; } Demo Heading This is demo text. This is another demo text. OutputExampleLet us see another example − Live Demo div { text-transform: lowercase; } Demo Heading THIS is demo text. This is ANOTHER demo text. Output
To strip all spaces out of a string in PHP, the code is as follows−Example Live DemoOutputThis will produce the following output−ThisisateststrinTo remove the whitespaces only, the below code can be used−Example Live DemoOutputThis will produce the following output. The str_replace function replaces the given input string with a specific character or string−thisisateststringTo remove whitespace that includes tabs and line end, the code can be used−Example Live DemoHere, the preg_match function is used with regular expressions. It searches for a pattern in a string and returns True if the pattern exists and false otherwise. This will produce the following output−thisisateststringRead More
Yes, it is possible to combine filter_input() with AND/OR in PHP. This can be done by looping over the POST fields−$value = filter_input(INPUT_POST, 'field', FILTER_DEFAULT, is_array($_POST['field']) ? FILTER_REQUIRE_ARRAY : NULL);An equivalent for the same user for each loop has been shown below−$memory = array(); //looping through all posted values foreach($_POST as $key => $value) { //applying a filter for the array if(is_array($value)) { $ memory [$key] = filter_input(INPUT_POST, $key, {filters for array}); } else { $ memory [$key] = filter_input(INPUT_POST, $key, {filters for scalar}); } }
PHPStorm can be used to test PHP applications using the PHPUnit testing framework.The PHP interpreter needs to be configured in phpstorm.The Composer should be installed and initialized with respect to the current project.Below are the steps to configure PHPUnit testing −Download phpunit.phar (manually or using the composer) and save it on your machine.The PHPUnit needs to be integrated with a PhpStorm project. PHPUnit can be configured manually or automatically.A PHPUnit test needs to be generated for the class.Once the test has been generated, PHPUnit test methods need to be generated.Post this, the PHPUnit test needs to be debugged and run.Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP