array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.decoct.php', 1 => 'decoct', ), 'up' => array ( 0 => 'ref.math.php', 1 => 'Math 函数', ), 'prev' => array ( 0 => 'function.dechex.php', 1 => 'dechex', ), 'next' => array ( 0 => 'function.deg2rad.php', 1 => 'deg2rad', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/math/functions/decoct.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4, PHP 5, PHP 7, PHP 8)
decoct — 十进制转换为八进制
返回一字符串,包含有给定 num
参数的八进制表示。可以转换的最大数字取决于平台。对于
32 位平台通常是十进制的 4294967295
,结果是 37777777777
。对于
64 位平台通常是十进制的 9223372036854775807
,结果是 777777777777777777777
。
num
待转换的十进制值
num
参数八进制表示的字符串。
示例 #1 decoct() 示例
<?php
echo decoct(15) . "\n";
echo decoct(264);
?>
以上示例会输出:
17 410