Знаю, что вопрос не сильно сложный, но я уже в ступоре. Возможно просто туплю. Есть вот такой массив:
Array (
[suggestions] =>
Array (
[0] =>
Array (
[value] => ИП Васильев Марьян Викторович [unrestricted_value] => ИП Васильев Марьян Викторович [data] =>
Array (
[citizenship] => [source] => [qc] => [hid] => f376421a4a3109431a90b379d69643d7322d8f532a9da821a64102b2f7f69520 [type] => INDIVIDUAL [state] =>
Array (
[status] => ACTIVE [actuality_date] => 1546300800000 [registration_date] => 1521763200000 [liquidation_date] => ) [opf] =>
Array (
[type] => 2014 [code] => 50102 [full] => Индивидуальный предприниматель [short] => ИП ) [name] =>
Array (
[full_with_opf] => Индивидуальный предприниматель Васильев Марьян Викторович [short_with_opf] => ИП Васильев Марьян Викторович [latin] => [full] => Васильев Марьян Викторович [short] => ) [inn] => 774316226132 [ogrn] => 318774600158117 [okpo] => [okved] => 62.09 [okveds] => [authorities] => [documents] => [licenses] => [address] =>
Array (
[value] => г Москва [unrestricted_value] => г Москва [data] =>
Array (
[postal_code] => 101000 [country] => Россия [region_fias_id] => 0c5b2444-70a0-4932-980c-b4dc0d3f02b5 [region_kladr_id] => 7700000000000 [region_with_type] => г Москва [region_type] => г [region_type_full] => город [region] => Москва [area_fias_id] => [area_kladr_id] => [area_with_type] => [area_type] => [area_type_full] => [area] => [city_fias_id] => 0c5b2444-70a0-4932-980c-b4dc0d3f02b5 [city_kladr_id] => 7700000000000 [city_with_type] => г Москва [city_type] => г [city_type_full] => город [city] => Москва [city_area] => [city_district_fias_id] => [city_district_kladr_id] => [city_district_with_type] => [city_district_type] => [city_district_type_full] => [city_district] => [settlement_fias_id] => [settlement_kladr_id] => [settlement_with_type] => [settlement_type] => [settlement_type_full] => [settlement] => [street_fias_id] => [street_kladr_id] => [street_with_type] => [street_type] => [street_type_full] => [street] => [house_fias_id] => [house_kladr_id] => [house_type] => [house_type_full] => [house] => [block_type] => [block_type_full] => [block] => [flat_type] => [flat_type_full] => [flat] => [flat_area] => [square_meter_price] => [flat_price] => [postal_box] => [fias_id] => 0c5b2444-70a0-4932-980c-b4dc0d3f02b5 [fias_code] => 77000000000000000000000 [fias_level] => 1 [fias_actuality_state] => 0 [kladr_id] => 7700000000000 [geoname_id] => [capital_marker] => 0 [okato] => 45000000000 [oktmo] => 45000000 [tax_office] => 7700 [tax_office_legal] => 7700 [timezone] => UTC+3 [geo_lat] => 55.7540471 [geo_lon] => 37.620405 [beltway_hit] => [beltway_distance] => [metro] => [qc_geo] => 4 [qc_complete] => [qc_house] => [history_values] => [unparsed_parts] => [source] => ГОРОД МОСКВА [qc] => 0 ) ) [phones] => [emails] => [ogrn_date] => [okved_type] => 2014
)
)
)
)
Вопрос: как вывести из него данные?
Код запроса:
if(!empty($_POST['inn'])) {
$inn=trim($_POST['inn']);
$inn=htmlspecialchars($inn);
$res = Dadata::suggest("party", array("query"=>$inn, "count"=>2));
В переменной $res лежит весь этот массив выше. При попытке вывести $res[0] ругается на отсутствие ключа. А если $res['value'] пишет Illegal string offset 'value'.
Если выводить $res->value, ругается, что это не объект.
В общем я запутался. Подскажите умные люди, куда копать?