略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: decoct

2024-04-28

decoct

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

decoct十进制转换为八进制

说明

decoct(int $number): string

返回一字符串,包含有给定 number 参数的八进制表示。所能转换的最大数值为十进制的 4294967295,其结果为 "37777777777"。

参数

number

待转换的十进制值

返回值

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

范例

示例 #1 decoct() 范例

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

以上例程会输出:

17
410

参见

add a noteadd a note

User Contributed Notes 1 note

up
-1
ethernidee at yandex dot ru
6 years ago
Negative numbers are not supported.

官方地址:https://www.php.net/manual/en/function.decoct.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3