baocaixiong
V2EX  ›  PHP

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

  •  
  •   baocaixiong · May 14, 2016 · 3057 views
    This topic created in 3841 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   ·   4426 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 06:57 · PVG 14:57 · LAX 22:57 · JFK 01:57
    ♥ Do have faith in what you're doing.