Click here to Skip to main content
15,881,381 members

Comments by Member 13967442 (Top 9 by date)

Member 13967442 1-Sep-18 5:19am View    
one header, contains info about # records that needs to be unpacked for that particular packet. and so the info in each header is different. e.g one packet can have 2 records or the next packet could be 5...according to the read in each $header['L# of Records'];
Member 13967442 31-Aug-18 15:16pm View    
what I am saying is, the above solution only works for the first packet,
$numRecords = $header['L# of Records']; // the value in the $numRecords is the number of records in the first first packet. how do I loop to get $numRecords in the header file of each packet.
Member 13967442 31-Aug-18 13:12pm View    
what about reading the next packet header?
Member 13967442 31-Aug-18 12:35pm View    
$header = unpack ($header_format, $data);
$numRecords = $header['L# of Records'];

for ($i = 0; i < $numRecords; $i++)
{
$record = unpack ($record_format, $data, $i);
}

I believe the above code might unpack the first packet, how do I do it for next packet until to the end of file
Member 13967442 31-Aug-18 11:39am View    
the record has a size of 30 and the header 18 in size, that is how i counted it