php 进制转换base_convert

16进制 转为 8进制

base_convert(number,frombase,tobase);

参数描述
number 必需。规定要转换的数。
frombase 必需。规定数字原来的进制。介于 2 和 36 之间(包括 2 和 36)。高于十进制的数字用字母 a-z 表示,例如 a 表示 10,b 表示 11 以及 z 表示 35。
tobase 必需。规定要转换的进制。介于 2 和 36 之间(包括 2 和 36)。高于十进制的数字用字母 a-z 表示,例如 a 表示 10,b 表示 11 以及 z 表示 35。
<?php
$hex = "E196"; 
echo base_convert($hex,16,8); 
?>

参考:

https://www.runoob.com/php/func-math-base-convert.html

原文地址:https://www.cnblogs.com/sea-stream/p/11330266.html