PHP code example of metroplex-systems / edifact
1. Go to this page and download the library: Download metroplex-systems/edifact library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
metroplex-systems / edifact example snippets
$message = \Estrato\Edifact\Message::fromFile("/tmp/order.edi");
foreach ($message->getAllSegments() as $segment) {
echo $segment->getSegmentCode() . "\n";
}
$message = new \Estrato\Edifact\Message;
$message->addSegment(new Segment("QTY", ["21", "8"]));
echo $message->serialize() . "\n";