Hello,
I'm trying to run the following code:
$found = 0;
$posCount = 0;
while (!($found)){
$b = substr($callBuf, $posCount, 24);
$data = unpack('H24',$b);
if ($data == "0000001d0000000700000001"){
$found = 1;
}
else{
++$posCount;
}
}
$callBuf contains binary data that were read from file,
and the code above suppose to find the position of "0000001d0000000700000001" in $callBuf.
if I print the $data variable I can see that in certain iteration it holds the needed value, but from some reason the comparison statement doesn't "catch" it!
I'm trying to run the following code:
$found = 0;
$posCount = 0;
while (!($found)){
$b = substr($callBuf, $posCount, 24);
$data = unpack('H24',$b);
if ($data == "0000001d0000000700000001"){
$found = 1;
}
else{
++$posCount;
}
}
$callBuf contains binary data that were read from file,
and the code above suppose to find the position of "0000001d0000000700000001" in $callBuf.
if I print the $data variable I can see that in certain iteration it holds the needed value, but from some reason the comparison statement doesn't "catch" it!