note 100944 deleted from function.base-convert by danbrown

From: Date: Tue, 16 Nov 2010 16:08:06 +0000
Subject: note 100944 deleted from function.base-convert by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-174089@lists.php.net to get a copy of this message
Note Submitter: ymod at mail dot ru ---- A little more simple way to convert a decimal number system in any base and an arbitrary set of symbols (simplified relative mentioned here dex2any): function dec2any( $num, $base=62, $index=false ){ if ( ! $index ) $index = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; for( $num; $num > 0; $num = floor( $num/$base ) ) $result = $index{$num % $base}.$result; return $result; }

« previous php.notes (#174089) next »