Last active
December 27, 2015 23:39
-
-
Save usk81/7407168 to your computer and use it in GitHub Desktop.
バイナリのダンプ。
なにげに使いそうなので
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* バイナリのダンプ。 | |
* なにげに使いそうなので | |
*/ | |
public function bin_dump($data) | |
{ | |
$binary = unpack("C*", $data ); | |
$result = ''; | |
foreach($binary as $v) | |
{ | |
$result .= sprintf("%02x ",$v); | |
} | |
return $result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment