PHP dechex( ) Function Last Updated : 22 Jun, 2023 Comments Improve Suggest changes Like Article Like Report The dechex() is a built-in function in PHP and is used to convert a given decimal number to an equivalent hexadecimal number. The word 'dechex' in the name of function stands for decimal to hexadecimal. The dechex() function works only with unsigned numbers. If the argument passed to it is negative then it will treat it as an unsigned number. The largest number that can be converted is 4294967295 in decimal resulting to "ffffffff". Syntax: string dechex($value) Parameters: This function accepts a single parameter $value. It is the decimal number you want to convert in hexadecimal representation. Return Value: It returns the hexadecimal string representation of number passed to it as argument. Examples: Input : dechex(10) Output : a Input : dechex(47) Output : 2f Input : dechex(4294967295) Output : ffffffff Below programs illustrate dechex() function in PHP: Passing 10 as a parameter: html <?php echo dechex(10); ?> Output: a Passing 47 as a parameter: html <?php echo dechex(47); ?> Output: 2f When the largest possible decimal number is passed as a parameter: html <?php echo dechex(4294967295); ?> Output: ffffffff Reference: https://www.php.net/manual/en/function.dechex.php Comment S Shubrodeep Banerjee Follow 0 Improve S Shubrodeep Banerjee Follow 0 Improve Article Tags : Misc Web Technologies PHP PHP-math PHP-function +1 More Explore PHP Tutorial 8 min read BasicsPHP Syntax 4 min read PHP Variables 5 min read PHP | Functions 8 min read PHP Loops 4 min read ArrayPHP Arrays 5 min read PHP Associative Arrays 4 min read Multidimensional arrays in PHP 5 min read Sorting Arrays in PHP 4 min read OOPs & InterfacesPHP Classes 2 min read PHP | Constructors and Destructors 5 min read PHP Access Modifiers 4 min read Multiple Inheritance in PHP 4 min read MySQL DatabasePHP | MySQL Database Introduction 4 min read PHP Database connection 2 min read PHP | MySQL ( Creating Database ) 3 min read PHP | MySQL ( Creating Table ) 3 min read PHP AdvancePHP Superglobals 6 min read PHP | Regular Expressions 12 min read PHP Form Handling 4 min read PHP File Handling 4 min read PHP | Uploading File 3 min read PHP Cookies 9 min read PHP | Sessions 7 min read Like