Found 1060 Articles for PHP

filter_input() function in PHP

Ankith Reddy
Updated on 27-Dec-2019 10:24:27

630 Views

The filter_input() function gets a name of external variable and filters it optionally.Syntaxfilter_input(type, var, filtername, options)Parameterstype − There are five types of inputs to check i.e. INPUT_GET, INPUT_POST, INPUT_COOKIE, INPUT_SERVER, or INPUT_ENV.var − The name of variable.filtername − The name of filter to get ID.options − Specifies options to use.ReturnThe filter_input() function returns the value of the variable on success, false on failure, or null if the parameter of variable is not set.Example Live Demo

filter_id() function in PHP

Arjun Thakur
Updated on 27-Dec-2019 10:23:35

320 Views

The filter_id() function returns the filter ID of provided filter name.Syntaxfilter_id(filtername)Parametersfiltername − The name of filter to get the ID from.ReturnThe filter_id() function returns filter ID on success or FALSE, if the filter does not exist.ExampleOutputThe following is the output.int = 257 boolean = 258 float = 259 validate_regexp = 272 validate_domain = 277 validate_url = 273 validate_email = 274 validate_ip = 275 validate_mac = 276 string = 513 stripped = 513 encoded = 514 special_chars = 515 full_special_chars = 522 unsafe_raw = 516 email = 517 url = 518number_int = 519 number_float = 520 magic_quotes = 521 callback = 1024

filter_has_var() function in PHP

Ankith Reddy
Updated on 27-Dec-2019 10:22:28

395 Views

The filter_has_var() function is used to check that variable of specified type exists or not.Syntaxfilter_has_var(type, var)Parameterstype − There are five types of inputs to check i.e. INPUT_GET, INPUT_POST, INPUT_COOKIE, INPUT_SERVER, or INPUT_ENV.var − The name of variable.ReturnThe filter_has_var() function returns true on success and false on failure.ExampleThe following is an example that is a quick check for the input variable "email”. The value INPUT_GET is used for this. Live Demo

tanh() function in PHP

Samual Sam
Updated on 27-Dec-2019 10:03:38

132 Views

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

tan() function in PHP

karthikeya Boyini
Updated on 27-Dec-2019 10:02:10

84 Views

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

srand() function in PHP

Samual Sam
Updated on 27-Dec-2019 10:01:04

214 Views

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

sqrt() function in PHP

karthikeya Boyini
Updated on 27-Dec-2019 10:00:14

103 Views

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

sinh() function in PHP

Samual Sam
Updated on 27-Dec-2019 09:59:16

99 Views

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

zip_read() function in PHP

karthikeya Boyini
Updated on 27-Dec-2019 09:58:15

51 Views

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

zip_open() function in PHP

Samual Sam
Updated on 26-Jun-2020 09:56:31

79 Views

The zip_open() function opens a zip file for reading. It returns an open zip file on success and FALSE on failure.Syntaxzip_open(zip_file)Parameterszip_file − The path of the file to be opened.ReturnThe zip_open() function returns an open zip file on success and FALSE on failure.ExampleOutputCompressed: 90 Compressed: 12 Compressed: 67

Advertisements