PHP decbin( ) Function Last Updated : 22 Jun, 2023 Comments Improve Suggest changes 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 decbin( ) 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 end() Function The end() function is an inbuilt function in PHP and is used to find the last element of the given array. The end() function changes the internal pointer of an array to point to the last element and returns the value of the last element.Syntax:end($array)Parameters:This function accepts a single par 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 count() Function The count() function in PHP is used to count the number of elements in an array or the countable properties of an object. The function returns an integer value representing the number of items present.Syntax:count($array, mode)In this syntax:$array (mandatory): Refers to the array, whose elements ar 3 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 PHP eval() Function PHP eval() function in PHP is an inbuilt function that evaluates a string as PHP code. Syntax: eval( $string ) Parameters: This function accepts a single parameter as shown in the above syntax and described below. $string: It must consist of a valid PHP code to be evaluated but should not contain op 2 min read PHP | Functions A function in PHP is a self-contained block of code that performs a specific task. It can accept inputs (parameters), execute a set of statements, and optionally return a value. PHP functions allow code reusability by encapsulating a block of code to perform specific tasks.Functions can accept param 8 min read Like