Closed salvisb closed 8 years ago
Real example from : https://github.com/uldisn/edifactdata/blob/master/commands/ReadTerminalPop3Command.php
$f = explode(PHP_EOL, $data);
$EdiReader = new EDI\Reader($f);
$terminal = $EdiReader->readEdiDataValue('UNB', 2);
$message_ref_number = $EdiReader->readEdiDataValue('UNH', 1);
$prepare_date = $EdiReader->readEdiDataValue('UNB', 4, 0);
$prepare_time = $EdiReader->readEdiDataValue('UNB', 4, 1);
For general reading use: https://github.com/sabas/edifact/blob/master/src/EDI/Reader.php#L80
Specialised for segments:
What is preferred method for reading multiple segments, for example if I want to get an array of all LIN segments? Should I write my own script for finding needed segments or it is done with EDI Reader?
Thanks!