Javatpoint Logo
Javatpoint Logo

PHP dechex() Function

The dechex() is predefined PHP mathematical function, which is used to convert decimal number to hexadecimal number.

Syntax:

Parameter Description Required/Optional
number Specify the decimal value Required

Example 1

Output:

Your Decimal number is : 7
By using 'dechex()'function, your Hexadecimal number is :7

Example 2

Output:

Your Decimal number is : 10
By using 'dechex()'function, your Hexadecimal number is :a

Example 3

Output:

Your Decimal number is : 30
By using 'dechex()'function, your Hexadecimal number is :1e

Example 4

Output:

Your Decimal number is : 1587
By using 'dechex()'function, your Hexadecimal number is :633

Example 5

Output:

Your Decimal number is : 70
By using 'dechex()'function, your Hexadecimal number is :46

Example 6

Output:

ffffffff
ffffffff
ffffffff

Next TopicPHP Math





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA