PHP 36進位互轉10進位

無意間在PHP.net翻到 string base_convert ( string $number , int $frombase , int $tobase ) 這個函數,可以自訂任意進位來轉換。看來時常出現在網路上的36進位使用非常合適。可以替代之前寫的笨方了。一行函數替代掉十幾行拆字乘法..... //36進位轉10進位 // input z // output 35 echo base_convert($hexadecimal, 36, 10); //10進位轉36進位 // input 36 // output 10 echo base_convert($hexadecimal, 10, 36);

Share this

Related Posts

Previous
Next Post »

3 意見

意見
2015年1月28日 上午12:49 delete

Spot On With This Write-up, I Really Suppose This Web Site Wants Rather More Consideration. I?ll Probably Be Again To Learn Much More, Thanks For That Info. uno judi bola

Reply
avatar
2015年12月10日 下午8:31 delete

Naturally Like Your Website But You Need To Check The Spelling On Quite A Few Of Your Posts. Many Of Them Are Rife With Spelling Problems And I Find It Very Troublesome To Tell The Truth Nevertheless I?ll Certainly Come Back Again.http://www.agenify.com

Reply
avatar
2015年12月10日 下午8:39 delete

Naturally Like Your Website But You Need To Check The Spelling On Quite A Few Of Your Posts. Many Of Them Are Rife With Spelling Problems And I Find It Very Troublesome To Tell The Truth Nevertheless I?ll Certainly Come Back Again.http://www.agenify.com

Reply
avatar