Guest User

Untitled

a guest
Dec 13th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.19 KB | None | 0 0
  1. <?php
  2.    function decbin2($num){
  3.       $num2 = $num;
  4.       while($num >= 1){
  5.         $bin .= $num % 2;
  6.         $num /= 2;
  7.       }  
  8.       return ($num2 < 1) ? 0 : (int)strrev($bin);
  9.    }
  10. ?>
Add Comment
Please, Sign In to add comment