Found 34489 Articles for Programming

imagecolorexact() function in PHP

Arjun Thakur
Updated on 31-Dec-2019 07:20:41

48 Views

The imagecolorexact() function gets the index of the specified color.Syntaximagecolorexact ( $img, $red, $green, $blue )Parametersimg: Image resource created with imagecreatetruecolor().red: Red color componentgreen: Green color componentblue: Blue color componentReturnThe imagecolorexact() function returns the index of the specified color in the palette, or -1 if the color does not exist.ExampleThe following is an example: Live DemoOutputThe following is the output:Array ( [0] => 1989170 [1] => 5273700 [2] => 1658930 )

imagecolorclosesthwb() function in PHP

George John
Updated on 31-Dec-2019 07:20:04

27 Views

The imagecolorclosesthwb() function gets the index of the color which has the hue, white and blacknessSyntaximagecolorclosesthwb ( $img, $red, $green, $blue )Parametersimg: Create image with imagecreatetruecolor()red: Red color componentgreen: Green color componentblue: Blue color componentReturnThe imagecolorclosesthwb() function returns an integer with the index of the color which has the hue, white and blackness nearest the given color.ExampleThe following is an example: Live DemoOutputThe following is the output:HWB = 87

imagecolorclosestalpha() function in PHP

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 the index of the closest color in the palette.ExampleThe following is an example: Live Demo

imageflip() function in PHP

George John
Updated on 31-Dec-2019 07:18:28

223 Views

The imageflip() function is used to flip an image using given mode.Syntaxbool imageflip(img, mode )Parametersimg: An image resource created using imagecreatetruecolor()mode: The flip mode. Here are the possible values:IMG_FLIP_HORIZONTAL – Flips the image horizontally.IMG_FLIP_VERTICAL – Flips the image vertically.IMG_FLIP_BOTH – Flips the image both horizontally and vertically.ReturnThe imageflip() function returns TRUE on success or FALSE on failure.ExampleThe following is an example that flips an image horizontally:OutputThe following is the output:

imagepolygon() function in PHP

Arjun Thakur
Updated on 31-Dec-2019 07:17:56

280 Views

The imagepolygon() function is used to draw a polygon.Syntaxbool imagepolygon( $img, $points, $num_points, $color)Parameters$img: Create a blank image with imagecreatetruecolor() function.$points: An array with vertices of polygon.$num_points: Total number of vertices in a polygon.$color: A color identifier created with imagecolorallocate() function.ReturnThe imagepolygon() function returns TRUE on success or FALSE on failure.ExampleThe following is an example:OutputThe following is the output:

gmp_rootrem() function in PHP

karthikeya Boyini
Updated on 31-Dec-2019 07:01:47

32 Views

The gmp_rootrem() function is used to calculate the nth root of a GMP number. It returns the integer component of the nth root and remainder.Syntaxgmp_rootrem($n,$root)Parametersn − It can be GMP object in PHP version 5.6 and later. Can also be numeric strings.root − The root of the number nReturnThe gmp_rootrem()function returns the integer component of the nth root and remainder.ExampleThe following is an example −OutputThe following is the output −Array (    [0] => GMP Object ( [num] => 3 )    [1] => GMP Object ( [num] =>6 ) )

IntlChar getCombiningClass() function in PHP

Samual Sam
Updated on 31-Dec-2019 06:59:42

27 Views

The IntlChar getCombiningClass() function is used to get the combining class of the value val.Syntaxint IntlChar::getCombiningClass (val)Parametersval − An integer or character encoded as a UTF-8 string.ReturnThe IntlChar getCombiningClass() function returns the combining class of the value val.ExampleThe following is an example −OutputThe following is the output −int(0) NULL

IntlChar getUnicodeVersion() function in PHP

karthikeya Boyini
Updated on 31-Dec-2019 06:37:59

14 Views

The IntlChar getUnicodeVersion() function is used to get the Unicode version.Syntaxarray IntlChar::getUnicodeVersion ()ParametersNAReturnThe IntlChar getUnicodeVersion() function returns thearray containing the Unicode version number.ExampleThe following is an example −OutputThe following is the output −array(4) { [0]=> int(6) [1]=> int(3) [2]=> int(0) [3]=> int(0) }

IntlChar getFC_NFKC_Closure() function in PHP

Samual Sam
Updated on 31-Dec-2019 06:39:39

49 Views

The IntlChar getFC_NFKC_Closure() function is used to get the FC_NFKC_Closure property for the value val.SyntaxIntlChar::getFC_NFKC_Closure(val)Parametersval − An integer or character encoded as a UTF-8 string.ReturnThe IntlChar getFC_NFKC_Closure()function returns the FC_NFKC_Closure property string for the entered value val.ExampleThe following is an example −OutputThe following is the output −NULL string(0) "" NULL NULL

IntlChar getBidiPairedBracket() function in PHP

karthikeya Boyini
Updated on 31-Dec-2019 06:39:11

27 Views

The IntlChar getBidiPairedBracket() function is used to get the paired bracket character for the value val.SyntaxIntlChar::getBidiPairedBracket (val)Parametersval − An integer or character encoded as a UTF-8 string.ReturnThe IntlChar getBidiPairedBracket()function returns the mapped paired bracket.ExampleThe following is an example −OutputThe following is the output −int(15) string(1) ")" NULL string(1) "J"

Advertisements