baocaixiong
V2EX  ›  PHP

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

  •  
  •   baocaixiong · May 14, 2016 · 2982 views
    This topic created in 3804 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   ·   Privacy   ·   Solana   ·   6083 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 02:19 · PVG 10:19 · LAX 19:19 · JFK 22:19
    ♥ Do have faith in what you're doing.