PHP decbin( ) Function Last Updated : 22 Jun, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report While working with numbers, many times we need to convert the bases of number and one of the most frequent used conversion is decimal to binary conversion. PHP provides us with a built-in function, decbin() for this purpose.The decbin() function in PHP is used to return a string containing a binary representation of the given decimal number argument. decbin stands for decimal to binary. Syntax: string decbin(value) Parameters: This function accepts a single parameter value. It is the decimal number which you want to convert in binary representation. Return Value: It returns a string that represent the binary value of the decimal number passed to the function as argument. Examples: Input : decbin(12) Output : 1100 Input : decbin(26) Output : 11010 Input : decbin(2147483647) Output : 1111111111111111111111111111111 (31 1's) Below programs illustrate the decbin() function in PHP: Passing 12 as a parameter html <?php echo decbin(12); ?> Output: 1100 Passing 26 as a parameter: html <?php echo decbin(26); ?> Output: 11010 When the largest signed integer is passed as a parameter: html <?php echo decbin(2147483647); ?> Output: 1111111111111111111111111111111 Reference: http://php.net/manual/en/function.decbin.php Comment More infoAdvertise with us Next Article PHP | exit( ) Function S Shubrodeep Banerjee Follow Improve Article Tags : Misc Web Technologies PHP PHP-math PHP-function +1 More Practice Tags : Misc Similar Reads 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 bindec( ) Function While working with numbers, many times we need to convert the bases of number and one of the most frequent used conversion is binary to decimal conversion. PHP provides us with a built-in function bindec() for this purpose. The bindec() function in PHP is used to return the decimal equivalent of the 1 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 | 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 asin( ) Function Trigonometry is an important part of mathematics and PHPâs math functions provides us with some functions which are very useful for calculations involving trigonometry. One of such function is asin() function. The asin() function in PHP is used to find the arc sine of a number in radians. We already 2 min read PHP abs() Function The abs() function is an inbuilt function in PHP which is used to return the absolute (positive) value of a number. The abs() function in PHP is identical to what we call modulus in mathematics. The modulus or absolute value of a negative number is positive. Syntaxnumber abs( value )ParametersThe ab 1 min read Like