title: How to compress a very large number into alphanumeric (in PHP)?
body: <p>I want to compress a very large number into alphanumeric[0-9a-zA-Z].
  Of'course, the easiest way is to use a in-build php function called 'base64_encode()', but I quite depreciate this method,  which making extra chars such as '/' and '='. Even more, base64_encode do nothing for compressing the number, because this function regard the number as a string. </p>
  
  <p>I had thought about another in-bulid function called 'base_convert()', but it can just convert the number into a charset [0-9a-z], making the result more longer.</p>
  
  <p>I am now using a cheap way to achieve my goal:
      
  
  <pre><code>function compress_int($num) {
      $chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
  
      $result = '';
  
      while( $num ) {
          $mod = $num % 52;
          $num = intval($num / 52);
  
          $result .= $chars[$mod];
      }
  
      return $result;
  }
  </code></pre>
  
  <p>However, I think it very inefficiency. So I quite appreciate the one who can tell me a better way with higher efficiency. ^_^</p>