LoginSignup
4
4

More than 5 years have passed since last update.

PHPで binary ダンプ。

Posted at

実用的?って言われるとどうか知らないけど、
とりあえず作ったから共有。

binary_dump.php
/**
 * バイナリのダンプ。
 * なにげに使いそうなので
 */
public function bin_dump($data)
{
    $binary = unpack("C*", $data );
    $result = '';
    foreach($binary as $v)
    {
        $result .= sprintf("%02x ",$v);
    }
    return $result;
}

おんなじこと書いてるだけだけど、
gistにも書いたので。
べっ、別にあんたのために書いたんじゃないからね Σ(///□///)ソ、ソンナンジャナイシッ!

4
4
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4