Ankith Reddy has Published 1070 Articles

imagecolorallocatealpha() function in PHP

Ankith Reddy

Ankith Reddy

Updated on 31-Dec-2019 07:22:02

198 Views

The imagecolorallocatealpha() function allocates a color for an image.Syntaximagecolorallocatealpha ( img, red, green, blue, alpha )Parametersimg: Image resource created with imagecreatetruecolor().red: Red color componentgreen: Green color componentblue: Blue color componentalpha: The transparency of image, with 0 indicating completely opaque, whereas 127 indicating completely transparent.ReturnThe imagecolorallocatealpha() function returns a color identifier or FALSE ... Read More

imagecolorclosestalpha() function in PHP

Ankith Reddy

Ankith Reddy

Updated on 31-Dec-2019 07:19:16

38 Views

The imagecolorclosestalpha() function gets the index of closet color with alpha value.Syntaximagecolorclosestalpha ( img, red, green, blue, alpha )Parametersimg: Image resource created with imagecreatetruecolor().red: Red color componentgreen: Green color componentblue: Blue color componentalpha: The transparency of image, with 0 indicating completely opaque, whereas 127 indicating completely transparent.ReturnThe imagecolorclosestalpha() function returns ... Read More

imagesx() function in PHP

Ankith Reddy

Ankith Reddy

Updated on 31-Dec-2019 06:24:40

203 Views

The imagesx() function gets the width of image. It returns the width of the image or FALSE on errors.Syntaximagesx(img)Parametersimg: Image resource created with imagecreatetruecolor()ReturnThe imagesx() function returns the width of the image or FALSE on errors.ExampleThe following is an example: Live DemoOutputThe following is the output:450Read More

imagefill() function in PHP

Ankith Reddy

Ankith Reddy

Updated on 31-Dec-2019 06:21:35

251 Views

The imagefill() function is used to fill the image.Syntaximagefill(img, x, y, color)ParametersimgCreate a blank image with imagecreatetruecolor().x x-coordinate of start pointy y-coordinate of start pointcolor The fill color.ReturnThe imagefill() function returns TRUE on success or FALSE on failure.ExampleThe following is an example:OutputThe following is the output:Read More

gmp_or() function in PHP

Ankith Reddy

Ankith Reddy

Updated on 30-Dec-2019 10:53:17

31 Views

The gmp_or() function computes the bitwise OR of two GMP numbers.Syntaxgmp_or(n1, n2)Parametersn1: The first GMP number. It can be GMP object in PHP version 5.6 and later. Can also be numeric strings.n2: The second GMP number. It can be GMP object in PHP version 5.6 and later. Can also be ... Read More

sleep() function in PHP

Ankith Reddy

Ankith Reddy

Updated on 30-Dec-2019 06:46:44

682 Views

The sleep() function delays execution of the current script for short time period.Syntaxsleep(sec)Parameterssec− The number of seconds to delay the script.ReturnThe sleep() function returns zero on success.Example Live DemoOutputThe following is the output.02:54:50 02:54:52 02:54:57

ignore_user_abort() function in PHP

Ankith Reddy

Ankith Reddy

Updated on 30-Dec-2019 06:42:50

337 Views

The ignore_user_abort() function sets whether a remote client can abort the running of a script.Syntaxignore_user_abort(setting)Parameterssetting − True ignores user aborts in a script (the script will continue to run). This is false by default i.e. client aborts will cause the script to stop runningReturnThe ignore_user_abort() function returns previous value of ... Read More

filter_input() function in PHP

Ankith Reddy

Ankith Reddy

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

491 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 ... Read More

filter_has_var() function in PHP

Ankith Reddy

Ankith Reddy

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

299 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 ... Read More

FILTER_VALIDATE_FLOAT constant in PHP

Ankith Reddy

Ankith Reddy

Updated on 27-Dec-2019 10:21:28

209 Views

The FILTER_VALIDATE_FLOAT constant validates a value as a float number.ReturnThe FILTER_VALIDATE_FLOAT constant does not return anything.Example Live DemoOutputThe following is the output.float(291.9)

Advertisements