Exemplo n.º 1
0
 public function toArray()
 {
     $temp = $this->csv->jsonSerialize();
     $headings = $temp[0];
     $result = $headings;
     if (count($temp) > 1) {
         $result = [];
         for ($i = 1; $i < count($temp); ++$i) {
             $row = [];
             for ($j = 0; $j < count($headings); ++$j) {
                 $row[$headings[$j]] = $temp[$i][$j];
             }
             $expanded = [];
             foreach ($row as $key => $value) {
                 ArrayHelpers::set($expanded, $key, $value);
             }
             $result[] = $expanded;
         }
     }
     return $result;
 }