convert_base.php
来自「视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.」· PHP 代码 · 共 29 行
PHP
29 行
<?php//Include BaseX classinclude_once( "Math/Basex.php" );//mirror HEX character set an convert current code to new code$newcode = convert_base("5c", "012345679abcdef", "fedcba9876543210");echo $newcode . " (Result: a9)\n";$newcode = Math_Basex::baseConvert("14", 10, 2);echo $newcode . " (Result: 1110)\n";function convert_base($code, $oldbase, $newbase){ // take old base an input $base = new Math_Basex($oldbase); //convert code to base10 decimal number $number = $base->toDecimal($code); //change to the new base $base->setBase($newbase); //encode the decimal number and return the result to the function return $base->toBase($number);} ?>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?