EDI X.12 PHP Mapping - Resources Required
3 answers
If you know which segments and what value are in all segments. Then its just about php
$file = file_get_contents('/edi.x12');
$segments = explode(~\n,$file);
foreach($segments as $segment){
$elements = explode('*',$segment);
foreach($elements as $element){
switch($elements[0]){
case 'ISA':
break;
/// And so on
}
}
}
Then you will have an array consisting of all the segments in the file. If you just iterate over the array, you can get all the elements for a given segment.
But for creating x12 Edi file it is a little more complicated.
I don't see the point in the first conversion to Xml.
+4
source to share