PHP decbin() function
Complete PHP Math Reference
Definition and Usage
The decbin() function converts a decimal number to a binary number.
Syntax
Parameter |
Description |
dec_number |
Required. Specifies the decimal number to convert |
Example
<?php
echo decbin("3") . "<br />";
echo decbin("1") . "<br />";
echo decbin("1587") . "<br />";
echo decbin("7");
?>
|
The output of the code above will be:
Complete PHP Math Reference
|