Answer the question
In order to leave comments, you need to log in
How to extract the information we need from the JSON (VK API) response?
Good afternoon. Using the VK API, namely the wall.get method, I get data about the community, where information about the proposed news is stored.
It comes to me as a JSON response:
{"response":{"count":3,"items":[{"id":8,"from_id":443375543,"owner_id":-148880857,"date":1503264466,"marked_as_ads":0,"post_type":"suggest","text":"фыафоывлдфыов","can_publish":1,"can_delete":1,"comments":{"count":0}}]}}
$request_params_for_suggests = [
'access_token' => $token['access_token'],
'domain' => $screen_name,
'count' => '1',
'filter' => 'suggests',
'v' => '5.68',
];
$url_for_suggests = "https://api.vk.com/method/wall.get?" . http_build_query($request_params_for_suggests);
$result_suggests = file_get_contents($url_for_suggests);
$decode_suggests = json_decode($result_suggests);
foreach ($decode_suggests->response as $suggests_result)
$suggests = $result_suggests //Что тут надо прописать, чтобы получить информацию о "count" ? ;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question