Created
July 6, 2011 04:20
-
-
Save blockworks/1066557 to your computer and use it in GitHub Desktop.
文字列をバイナリにしてファイルに保存する(.act)
This file contains 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
<?php | |
$hex_str = "cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000333333ffffff0000ff222222cc0000"; | |
$bin_str = pack("H*" , $hex_str); | |
echo $bin_str; | |
$fp = fopen('test.act', 'w+'); | |
fwrite($fp, $bin_str); | |
fclose($fp); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment