Javatpoint Logo
Javatpoint Logo

PHP bindec() Function

PHP bindec() function is mathematical function, which is used to convert binary number to decimal number. It returns the decimal value of binary_string.

Note: To convert decimal number to binary number by sing decbin() function.

Syntax:

Parameter Description Required/Optional
binary_string Specify the binary string to convert and parameter value must be string. required

Example 1

Output:

Your binary number is : 110011
By using bindec()' function your decimal number is :51

Example 2

Output:

Your binary number is : 01
By using 'bindec()' function your decimal number is :1

Example 3

Output:

Your binary number is : 000110011
By using 'bindec()' function your decimal number is :51

Example 4

Output:

Your binary number is : 1010
int(10)

Example 5

Output:

Your binary number is : 10000
By using 'bindec()' function your decimal number is :16

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