You don't need any special functions like pack or unpack etc...although pack may be useful for specifying the needle to search for.
php doesn't apply any character encoding to strings, it leaves them as is, so it's binary friendly by default.
$hexMarker = 0x70000000;// or whatever
$binaryData = file_get_contents($filename);
$x = 5;
$pos = strpos($binaryData, $hexMarker);
if ($pos !== false) {
$start = $pos + strlen($hexMarker);
echo substr($binaryData, $start, $x);
}
you may consider using fopen and fread in an iterative fashion if the size of the file is large, as file_get_contents would consume a lot of memory in that case. But that's a separate question anyway.