1. Computing

Discuss in my forum

Decbin () PHP Function

By , About.com Guide

Definition: The Decbin () PHP Function is used to convert a decimal into a binary number. This is the opposite of Bindec () which is used to convert a binary number into a decimal.
Also Known As: Decimal to Binary
Examples:
 <?php 
 echo(decbin(1) . "<br />"); 
 echo(decbin(100) . "<br />"); 
 echo(decbin(12) . "<br />"); 
 echo(decbin(3453) . "<br />"); 
 ?> 
This returns the following binary:
1
1100100
1100
110101111101
  1. About.com
  2. Computing
  3. PHP / MySQL
  4. PHP Functions
  5. Decbin PHP Function - Convert a decimal into Binary

©2013 About.com. All rights reserved.