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: http://php.net/manual/en/function.dechex.php Comment More infoAdvertise with us Next Article PHP dechex( ) Function S Shubrodeep Banerjee Follow Improve Article Tags : Misc Web Technologies PHP PHP-math PHP-function +1 More Practice Tags : Misc Similar Reads PHP each() Function The each() function is an inbuilt function in PHP and is used to get the current element key-value pair of the given array to which the internal pointer is currently pointing. After returning the key and value of the current element the internal pointer is incremented by one in the array. Note: You 2 min read PHP decoct( ) Function In the earlier days of computing, octal numbers and the octal numbering system was very popular for counting inputs and outputs because as it works in counts of eight, inputs and outputs were in counts of eight, a byte at a time. Due to a wide usage of octal number system many times it happens that 2 min read PHP define() Function The define() function is basically used by programmers to create constant. Constants in PHP are very similar to variables and the only difference between both are the values of constants can not be changed once it is set in a program. define() returns a Boolean value. It will return TRUE on success 2 min read PHP | exit( ) Function The exit() function in PHP is an inbuilt function which is used to output a message and terminate the current script. The exit() function only terminates the execution of the script. The shutdown functions and object destructors will always be executed even if exit() function is called. The message 2 min read PHP acosh( ) Function In mathematics, the inverse hyperbolic functions are the inverse functions of the hyperbolic functions. For a given value of a hyperbolic function, the corresponding inverse hyperbolic function provides the corresponding hyperbolic angle. PHP provides us with builtin functions for inverse hyperbolic 1 min read Like