decbin()
Published Jul 8, 2023
Contribute to Docs
The decbin()
function converts a decimal number to a string containing a binary number.
Syntax
decbin(number);
Where number
is the decimal value to be converted to binary. The result returns a string that contains the binary number of the passed decimal value.
Example
<?phpecho decbin(333);?>
This will result in the following output:
101001101
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.