八進制轉換為十進制

octdec

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

octdec八進制轉換為十進制

說明

octdec(string $octal_string): number

返回 octal_string 參數所表示的八進制數的十進制等值。

參數

octal_string

要轉換的八進制的字串

返回值

octal_string 的十進制的表示

更新日誌

版本說明
4.1.0 該函式可以處理 integer 大數字,這種情況下,它會返回 float 型別。

範例

示例 #1 octdec() 例子

<?php
echo octdec('77') . "\n";
echo 
octdec(decoct(45));
?>

以上例程會輸出:

63
45

參見

Leave a Reply

Your email address will not be published. Required fields are marked *