PHP/Data Type/Binary Number
Версия от 10:37, 26 мая 2010; (обсуждение)
bindec: convert binary number to decimal
<?php
$orig_dec = 66251125;
$dec2bin = decbin($orig_dec);
$bin2dec = bindec($dec2bin);
echo "original decimal number: $orig_dec <br>";
echo "new binary number: $dec2bin <br>";
echo "back to decimal: $bin2dec <br>";
?>
decbin: convert to binary number
<?php
$orig_dec = 66251125;
$dec2bin = decbin($orig_dec);
$bin2dec = bindec($dec2bin);
echo "original decimal number: $orig_dec <br>";
echo "new binary number: $dec2bin <br>";
echo "back to decimal: $bin2dec <br>";
?>