- file_get_contents: documentation ( source)
- hex2bin: documentation ( source)
- bin2hex: documentation ( source)
- substr_replace: documentation ( source)
- str_replace: documentation ( source)
<?php
//lin bmp
$teemo = $_FILES['image_file']['tmp_name'];
$teemo = bin2hex(file_get_contents($teemo)); //画像バイナリ16進数化
$teemo = substr_replace($teemo,"36",20,2); //address=Aを36に書き換え
$teemo = str_replace('4c696e65616765', '', $teemo); //address=36から3Cまでの7byte削除
$teemo = hex2bin($teemo);