技术文章 > 后端开发 > php教程
php 如何写二进制文件
php v4 之後有packphp.net pack — Pack data into binary string
pack
$bom = mb_convert_encoding("", "unicode", "HTML-ENTITIES"); $fp = fopen('text.txt', 'w'); fwrite($fp, pack('a2', $bom));