<?php
 namespace App\Amadeus\FileParser; class Line_F extends \App\Amadeus\FileParser\LineAbstract { protected $structure = [ ['name' => 'MSGTAG', 'type' => 'AN', 'req' => 'M', 'val' => 'F-', 'len' => 2, ], ['name' => '_extra', 'type' => 'custom', ], ]; protected function parseFromStructure($structure, $content) { $header = $structure[0]; if (preg_match("/^{$header['val']}/", $content)) { $tree = []; $tree[$structure[1]['name']] = substr($content, strlen($header['val'])); return $tree; } return []; } } 