daily pastebin goal
44%
SHARE
TWEET

Untitled

a guest May 16th, 2018 105 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.   function hexer($input){
  3.     $answer ="";
  4.     while ($input > 0) {
  5.  
  6.     $answer =  HEX($input % 16).$answer;
  7.       $input =intval( $input / 16);
  8.     }    
  9.     echo "it is ".$answer;
  10.   }
  11.  
  12.   function HEX($input){
  13.     switch ($input){
  14.       case 10:
  15.         return "A";
  16.         break;
  17.       case 11:
  18.         return "B";
  19.         break;        
  20.       case 12:
  21.         return "C";
  22.         break;
  23.       case 13:
  24.         return "D";
  25.         break;
  26.       case 14:
  27.         return "E";
  28.         break;
  29.       case 15:
  30.         return "F";
  31.         break;
  32.      default:
  33.         return $input;
  34.      }
  35.   }
  36.  
  37.  
  38. hexer(16);
  39.  
  40.  
  41.  
  42. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top