function changeKey($currentKey, $keys){
$currentKey++;
if ((count($keys) - 1) > $currentKey)
{
die;
}
return $currentKey;
}
$keys = dadataKey($file);
$currentKey = 0;
foreach($itog as $dates){
$dadata = new Dadata($keys[$currentKey]['api'], $keys[$currentKey]['secret']);
$dadata->init();
$result = $dadata->clean("address", $dates['ADDRESS']);
$dadata->close();
if ($result['error'])
{
$currentKey = changeKey($currentKey, $keys);
continue;
}
}