PHP Articles

Page 65 of 81

imagecolorclosesthwb() function in PHP

George John
George John
Updated on 15-Mar-2026 94 Views

The imagecolorclosesthwb() function finds the index of the color that most closely matches a given RGB color using the HWB (Hue, Whiteness, Blackness) color model. This function is useful for color matching in palette−based images. Syntax imagecolorclosesthwb($image, $red, $green, $blue) Parameters $image − An image resource created by image creation functions like imagecreate() or imagecreatefromgif() $red − Red color component value (0−255) $green − Green color component value (0−255) $blue − Blue color component value (0−255) Return Value Returns an integer representing the index of the color in the image ...

Read More

imagecolorclosestalpha() function in PHP

Ankith Reddy
Ankith Reddy
Updated on 15-Mar-2026 112 Views

The imagecolorclosestalpha() function finds the index of the closest color in an image palette that matches the specified RGBA values. This function is particularly useful when working with palette-based images where you need to find the best color match including transparency. Syntax imagecolorclosestalpha(resource $image, int $red, int $green, int $blue, int $alpha) Parameters image − An image resource created by image creation functions like imagecreate() or imagecreatefrompng(). red − Red color component value (0-255). green − Green color component value (0-255). blue − Blue color component value (0-255). alpha − Alpha transparency value ...

Read More

imageflip() function in PHP

George John
George John
Updated on 15-Mar-2026 349 Views

The imageflip() function is used to flip an image using a given mode. This function modifies the image resource directly and is commonly used for creating mirror effects or rotating images. Syntax bool imageflip(resource $image, int $mode) Parameters $image − An image resource created using functions like imagecreatetruecolor(), imagecreatefrompng(), etc. $mode − The flip mode constant. Possible values are: IMG_FLIP_HORIZONTAL − Flips the image horizontally (left to right) IMG_FLIP_VERTICAL − Flips the image vertically (top to bottom) IMG_FLIP_BOTH − Flips the image both horizontally and vertically Return Value ...

Read More

imagepolygon() function in PHP

Arjun Thakur
Arjun Thakur
Updated on 15-Mar-2026 425 Views

The imagepolygon() function is used to draw a polygon on an image resource in PHP. This function is part of the GD library extension and allows you to create polygons with any number of vertices. Syntax bool imagepolygon(resource $image, array $points, int $num_points, int $color) Parameters $image − An image resource created with imagecreatetruecolor() or similar functions. $points − An array containing the x and y coordinates of the polygon's vertices in sequential order. $num_points − The total number of vertices (points) in the polygon. $color − A color identifier created with imagecolorallocate() ...

Read More

IntlChar getCombiningClass() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 87 Views

The IntlChar getCombiningClass() function is used to get the combining class value of a Unicode character. The combining class determines how a character interacts with adjacent characters in text rendering and normalization. Syntax int IntlChar::getCombiningClass(mixed $codepoint) Parameters codepoint − An integer codepoint value, or a character encoded as a UTF-8 string. Return Value Returns the combining class of the character as an integer. Returns 0 for base characters and non-zero values for combining marks. Returns NULL on failure or for invalid input. Example The following ...

Read More

get_browser() function in PHP

George John
George John
Updated on 15-Mar-2026 1K+ Views

The get_browser() function looks up the user's browscap.ini file and returns the capabilities of the user's browser. This function requires the browscap configuration setting in php.ini to be properly configured. Syntax get_browser(user_agent, return_array) Parameters user_agent − Optional. The name of HTTP user agent. If omitted, the current user agent is used. return_array − Optional. If set to true, the function returns an array instead of an object. Return Value The get_browser() function returns an object or array containing information about the user's browser capabilities, or FALSE ...

Read More

IntlChar getUnicodeVersion() function in PHP

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 78 Views

The IntlChar getUnicodeVersion() function is used to get the Unicode version that the ICU library is using. It returns an array containing version numbers that represent the Unicode standard version. Syntax array IntlChar::getUnicodeVersion() Parameters This function takes no parameters. Return Value The IntlChar getUnicodeVersion() function returns an array containing four integers representing the Unicode version number in the format [major, minor, micro, update]. Example The following example demonstrates how to get the Unicode version ? The output of the above code is ? ...

Read More

IntlChar getFC_NFKC_Closure() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 101 Views

The IntlChar::getFC_NFKC_Closure() function retrieves the FC_NFKC_Closure property for a given Unicode character. This property contains the string that the character maps to under NFKC (Normalization Form KC) normalization closure. Syntax IntlChar::getFC_NFKC_Closure(mixed $codepoint) Parameters codepoint − An integer codepoint value or a character encoded as a UTF−8 string. Return Value Returns the FC_NFKC_Closure property string for the given character, or null if the character has no FC_NFKC_Closure mapping. Example The following example demonstrates the function with various Unicode characters −

Read More

IntlChar getBidiPairedBracket() function in PHP

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 91 Views

The IntlChar::getBidiPairedBracket() function returns the paired bracket character for a given Unicode character. This function is useful when working with bidirectional text processing where you need to find the matching bracket for proper text rendering. Syntax IntlChar::getBidiPairedBracket(mixed $codepoint) Parameters codepoint − An integer codepoint value or a character encoded as a UTF-8 string. Return Value Returns the mapped paired bracket character as a string, or the original character if no paired bracket exists. Returns NULL for invalid input. Example The following example demonstrates how to find paired brackets ...

Read More

IntlChar getBlockCode() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 76 Views

The IntlChar::getBlockCode() function is used to get the Unicode allocation block containing the specified character value. This function helps identify which Unicode block a character belongs to, such as Basic Latin, Greek, or Miscellaneous Symbols. Syntax IntlChar::getBlockCode(mixed $codepoint) Parameters codepoint − An integer codepoint value (e.g., 0x41 for 'A') or a character encoded as a UTF-8 string (e.g., "A"). Return Value The function returns an integer representing the Unicode block code constant. Common block codes include ? IntlChar::BLOCK_CODE_BASIC_LATIN − For characters A-Z, a-z, 0-9 IntlChar::BLOCK_CODE_GREEK − For Greek ...

Read More
Showing 641–650 of 802 articles
« Prev 1 63 64 65 66 67 81 Next »
Advertisements