简体   繁体   中英

How to get real Hexadecimal number from Hex as String

How do I get the proper Hexadecimal number from a Hexadecimal string?

For example:

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

Thanks to @Ryan.

This does the Trick:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM