baocaixiong
V2EX  ›  PHP

请教,如何将 Python 代码: struct.unpack('<Q', binascii.unhexlify('b2bf98ce44010000')) 翻译成 PHP?

  •  
  •   baocaixiong · May 14, 2016 · 2791 views
    This topic created in 3678 days ago, the information mentioned may be changed or developed.
    import struct
    import binascii
    print struct.unpack('<Q', binascii.unhexlify('b2bf98ce44010000'))
    2 replies    2016-05-14 22:13:54 +08:00
    MrZephyrus
        1
    MrZephyrus  
       May 14, 2016
    http://www.php.net/manual/zh/function.unpack.php
    php 也能 unpack 二进制数据啊
    baocaixiong
        2
    baocaixiong  
    OP
       May 14, 2016
    @MrZephyrus
    嗯,忘记说了, unpack 在 5.6 之前不支持 P 参数,也就是 int64

    我一直在 5.5 的环境弄的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5891 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 49ms · UTC 03:21 · PVG 11:21 · LAX 20:21 · JFK 23:21
    ♥ Do have faith in what you're doing.