- while ($lines) {
- $id = array_shift($lines);
- if ($id === '') {
- continue;
- }
- $offset = array_shift($lines);
- if ($offset === '') {
- continue;
- }
- $id = intval($id);
- $headers[$id] = array('beginning' => intval($offset));
- while (true) {
- $hname = array_shift($lines);
- if ($hname === '') {
- break;
- }
- $hval = array_shift($lines);
- if ($hname == 'date') {
- $headers[$id][$hname] = @strtotime($hval);
- } else {
- $headers[$id][$hname] = $hval;