PHP octdec() 函数
octdec() 函数是 PHP 的数学函数,用于将八进制数转换为十进制数。
语法
octdec(octal_string);
Parameter | Description | Required/Optional |
---|---|---|
octal_string | octal string to convert | Required |
示例1
<?php
nos=36;
echo "Your number is :".nos;
echo "<br>"."By using 'octdec()' function your value is:".(octdec($nos));
?>
输出:
Your number is :36
By using 'octdec()' function your value is:30
示例2
<?php
nos=12;
echo "Your number is :".nos;
echo "<br>"."By using 'octdec()' function your value is:".(octdec($nos));
?>
输出:
Your number is :36
By using 'octdec()' function your value is:30
示例3
<?php
nos=3063;
echo "Your number is :".nos;
echo "<br>"."By using 'octdec()' function your value is:".(octdec($nos));
?>
输出:
Your number is :3063
By using 'octdec()' function your value is:1587
示例4
<?php
nos=106;
echo "Your number is :".nos;
echo "<br>"."By using 'octdec()' function your value is:".(octdec($nos));
?>
输出:
Your number is :106
By using 'octdec()' function your value is:70¬¬