Javatpoint Logo
Javatpoint Logo

PHP hexadec() Function

PHP hexadecimal() function is used to convert a hexadecimal to a decimal number. It returns the decimal equivalent of the hexadecimal string to a decimal number.

Syntax:

Parameter Description Required/Optional
hex_string hexadecimal string to convert Required

Example 1

Output:

Your number is :1e
By using 'floor()' function your value is:30

Example 2

Output:

Your number is :a
By using 'hexdec()' function your value is:10

Example 3

Output:

Your number is :11ff
By using 'floor()' function your value is:4607

Example 4

Output:

Your number is :cceeff
By using 'hexdec()' function your value is:13430527

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