octdec() 函數是 PHP 數學函數,用於將八進製數轉換為十進製數。
用法:
octdec(octal_string);
參數 | 描述 | 必需/可選 |
---|---|---|
octal_string | 要轉換的八進製字符串 | 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ŚŚ
相關用法
- PHP octdec( )用法及代碼示例
- PHP openssl_pkey_export()用法及代碼示例
- PHP openssl_pkcs12_export()用法及代碼示例
- PHP output_add_rewrite_var()用法及代碼示例
- PHP openssl_pkcs12_export_to_file()用法及代碼示例
- PHP ord()用法及代碼示例
- PHP ob_end_flush(), ob_end_clean()用法及代碼示例
- PHP openssl_get_cert_locations()用法及代碼示例
- PHP openssl_cipher_iv_length()用法及代碼示例
- PHP openssl_spki_verify()用法及代碼示例
- PHP openssl_get_curve_names()用法及代碼示例
- PHP openssl_get_cipher_methods()用法及代碼示例
- PHP openssl_spki_export_challenge()用法及代碼示例
- PHP opendir()用法及代碼示例
- PHP ob_start()用法及代碼示例
- PHP ob_get_clean()用法及代碼示例
- PHP openssl_pkcs12_read()用法及代碼示例
- PHP SimpleXMLElement children()用法及代碼示例
- PHP PHPUnit assertIsNotFloat()用法及代碼示例
- PHP ReflectionClass getTraitAliases()用法及代碼示例
注:本文由純淨天空篩選整理自 PHP octdec() Function。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。