index.php 747 Bytes
Newer Older
Kulya's avatar
Kulya committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
<?php require dirname(__DIR__) . '/vendor/autoload.php';
global $ALVC;
$ALVC = new AloVoice\AloVoiceConnector();
$confs = $ALVC->getConfigs();
// var_dump($confs);

$cmpTash = __DIR__."/CompaniesTashkent.csv";

$row = 0;

$arCompHead = [];
$arCompanies = [];

if (($handle = fopen($cmpTash, "r")) !== FALSE) {
    while (($data = fgetcsv($handle, 1024, ";")) !== FALSE) {
        $num = count($data);
		if($row==0){
			foreach($data as $hd) {
				$arCompHead[] = $hd;
			}
		}
		else {
			$arComp = [];
			foreach($data as $k=>$dt) {
				$arComp[$arCompHead[$k]] = $dt;
			}
			$arCompanies[] = $arComp;
		}
		
        $row++;
		
		if($row>10){ break; }
    }
    fclose($handle);
}

var_dump($arCompanies);
?>