簡體   English   中英

如何從十六進制作為字符串獲取真實的十六進制數

[英]How to get real Hexadecimal number from Hex as String

如何從十六進制字符串中獲取正確的十六進制數字?

例如:

<?php
$a = 'C8';
$b = 0xC8;
$c = doWhatHere($a);
$b === $c; // true

感謝@Ryan。

這是絕招:

<?php
$a = 'C8';
$b = 0xC8;
$c = intval($a, 16);
$b === $c; // true

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM