PHP decbin() Function Example

PHP decbin() Function Example


Posted in : PHP Posted on : January 28, 2011 at 6:22 PM Comments : [ 0 ]

In PHP, The decbin() function used for conversion decimal number to binary number.

PHP decbin() Function Example:

In PHP, The decbin() function used for conversion decimal number to binary number.

Syntax:

decbin(decimal_number)

where decimal_number is a decimal number passed as argument in this function.

Example:

<?php
$return = decbin(1234567);
echo "The value of decbin(1234567) is : " . $return . "<br />";

$return_value = decbin(7890);
echo "The value of decbin(7890) is : " . $return_value;
?> 

Output:

The value of decbin(1234567) is : 100101101011010000111
The value of decbin(7890) is : 1111011010010

Download Example Code

Go to Topic «PreviousHomeNext»

Your Comment:


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

 
Tutorial Topics