I have i file with structure in image. I want to extract data to array from that:
function get_data($file, $number)
{
if(!$fp = fopen ($file, 'rb')) return 0;
$fsize = filesize($file);
if(!$data = fread ($fp, $fsize)) return 0;
$data_format=
'@100/'.
'smember_id/'.
'cmember_name_length/'.
'a' . $member_name_length . 'member_name/'.
'C100other_data/';
$data = unpack ($data_format, $data);
fclose($file);
return $data;
}
How can I get the $member_name_length from the file? I want to create a function that if user input the $number, it returns a array of $number(th) data.
Thank you.
