[ "verify_peer"=>false, "verify_peer_name"=>false, ], ]; $bitrix_cars = []; $api_cars = []; $all_cars_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => IBLOCK_ID_CATALOG_CARS_NEW, ], false, false, [] ); while($all_cars_search_ob = $all_cars_search_res->GetNextElement()) { $car_search = $all_cars_search_ob->GetFields(); $car_search['PROPERTIES'] = $all_cars_search_ob->GetProperties(); $bitrix_cars[ $car_search['PROPERTIES']['UID']['VALUE'] ] = $car_search['CODE']; } $api_modifications_url = API_HOST."/site/Vehicle/GetModifications"; $content = file_get_contents($api_modifications_url, false, stream_context_create($arrContextOptions)); print $api_modifications_url."\n\n"; file_put_contents("./api_modifications.json", $content); $json = json_decode($content, true); foreach($json AS $car) { $name = "".$car['brand']['name']." ".$car['model']['name']." ".$car['modification'].""; $title = $name." ".$car['modificationYear'].""; $code = CUtil::translit( str_replace([""", " ", "+"], ['"', "-", "-plus-"], $title), "ru", [ "max_len" => 255, "change_case" => "L", "replace_space" => "-", "replace_other" => "-", "safe_chars" => "-" ] ); $api_cars[ $car['uid'] ] = $code; } print "bitrix cars: ".count($bitrix_cars)."\n"; print "ilsa cars: ".count($api_cars)."\n"; foreach($api_cars AS $uid => $code) { if(isset($bitrix_cars[ $uid ])) { if($code != $bitrix_cars[ $uid ]) { //print $uid."\n".$code."\n".$bitrix_cars[ $uid ]."\n\n"; } } else { print $uid." - ".$code."\n"; } } ?>