wpme_dec2sixtwo

The Jetpack by WordPress.com wpme dec2sixtwo function.

Description

wpme_dec2sixtwo( $num ); 

Parameters (1)

0. $num
The num.

Usage

  1. if ( !function_exists( 'wpme_dec2sixtwo' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/modules/shortlinks.php'; 
  3.  
  4. // The num. 
  5. $num = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wpme_dec2sixtwo($num); 
  9.  

Defined (1)

The function is defined in the following location(s).

/modules/shortlinks.php  
  1. function wpme_dec2sixtwo( $num ) { 
  2. $index = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; 
  3. $out = ""; 
  4.  
  5. if ( $num < 0 ) { 
  6. $out = '-'; 
  7. $num = abs( $num ); 
  8.  
  9. for ( $t = floor( log10( $num ) / log10( 62 ) ); $t >= 0; $t-- ) { 
  10. $a = floor( $num / pow( 62, $t ) ); 
  11. $out = $out . substr( $index, $a, 1 ); 
  12. $num = $num - ( $a * pow( 62, $t ) ); 
  13.  
  14. return $out;