PHP 8.3.4 Released!

decoct

(PHP 4, PHP 5, PHP 7, PHP 8)

decoct十进制转换为八进制

说明

decoct(int $num): string

返回一字符串,包含有给定 num 参数的八进制表示。可以转换的最大数字取决于平台。对于 32 位平台通常是十进制的 4294967295,结果是 37777777777。对于 64 位平台通常是十进制的 9223372036854775807,结果是 777777777777777777777

参数

num

待转换的十进制值

返回值

num 参数八进制表示的字符串。

示例

示例 #1 decoct() 示例

<?php
echo decoct(15) . "\n";
echo
decoct(264);
?>

以上示例会输出:

17
410

参见

add a note

User Contributed Notes 1 note

up
-2
ethernidee at yandex dot ru
8 years ago
Negative numbers are not supported.
To Top