<?php
error_reporting(0);
header('Content-Type: text/html; charset=utf-8');
$simple = simplexml_load_file('SEAT dealers_form.xml');
$arr = json_decode( json_encode($simple) , 1);
$xml_arr = $arr['Worksheet'][0]['Table']['Row'];
$main_arr = array();
$i = 0;
foreach($xml_arr as $row) {
$row_arr = $row['Cell'];
foreach($row_arr as $value) {
if($value) {
$main_arr[$i][] = $value['Data'];
}
}
$i++;
}
foreach($main_arr as $key => $item) {
if($key != 0 ) {
$dealers_arr[$item[1]][] = array(
'id_map' => $item[2],
'dealer' => $item[3],
'index_city' => $item[4],
'address' => $item[5],
'phone' => $item[6],
'dealer_email' => $item[7],
'active' => $item[8]
);
}
}
//echo '<pre>';
//print_r($dealers_arr);
//echo '</pre>';
?>