PHP code example of estrato / edifact
1. Go to this page and download the library: Download estrato/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/ */
estrato / 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";