Here on this example we replace hex values 0xA1 with 0x21, 0xA2 with 0x22 and 0xA3 with 0x23.
Code: Select all
$q = file_get_contents($filename);
$data = Array("\xA1" => "\x21", "\xA2" => "\x22", "\xA3" => "\x23");
foreach ($data as $key => $value) {
$q = str_replace($key, $value, $q);
}