baocaixiong
V2EX  ›  PHP

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

  •  
  •   baocaixiong · May 14, 2016 · 3073 views
    This topic created in 3851 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
    MrZephyrus
    May 14, 2016
    1
    http://www.php.net/manual/zh/function.unpack.php
    php 也能 unpack 二进制数据啊
    baocaixiong
    baocaixiong
    OP
    May 14, 2016
    2
    @MrZephyrus
    嗯,忘记说了, unpack 在 5.6 之前不支持 P 参数,也就是 int64

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