PHP 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.
Learn PHP on Codecademy
- Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
- Includes 6 Courses
- With Professional Certification
- Beginner Friendly.75 hours