<?php
   $contacts=array();
   $filename = "companies.txt";
   $handle = fopen($filename, "r");
   $contents = fread($handle, filesize($filename));
   fclose($handle);
   $data=explode(";",$contents);
   
   $contacts=array();
   for ($i=0;$i<count($data);$i+=9) {
      $conId=$data[$i];
      $conAssignedRef=$data[$i+1];
      $conName=$data[$i+2];
      $conPhone=$data[$i+3];
      $conEmail=$data[$i+4];
      $conWebsite=$data[$i+5];
      $conCountry=$data[$i+6];
      $contacts[]=array("$conId","$conAssignedRef",0,"$conName","$conPhone","$conEmail","$conWebsite","$conCountry",0,0,"?");
 	}
 	echo json_encode($contacts);
?>    