How can I do this Perl code in PHP?
print unpack ("H*", pack ("B*", "00000000100000012000000" ));
收起
当前问题酬金
¥ 0 (可追加 ¥500)
支付方式
扫码支付
支付金额 15 元
提供问题酬金的用户不参与问题酬金结算和分配
支付即为同意 《付费问题酬金结算规则》
Since pack/unpack in PHP doesn't support the B type, you'll have to use PHP's other functions instead. In this case, dechex and bindec.
dechex
bindec
echo dechex( bindec( "00000000100000012000000" ));
Edit: Or do it in a single function with base_convert:
echo base_convert("00000000100000012000000", 2, 16);
报告相同问题?