I can not figure out how to sort through the array.
There is an array in JSON format, how to sort it out correctly (for later writing to a file), the id value is of interest.
{"response": { "count": 5, "items": [{ "id": 456239196, "album_id": 262864474, "owner_id": -177279513, "user_id": 100, "sizes": [...], "text": "", "date": 1549408532 }, { "id": 456239198, "album_id": 262864474, "owner_id": -177279513, "user_id": 100, "sizes": [...], "text": "", "date": 1549470093 }, { "id": 456239200, "album_id": 262864474, "owner_id": -177279513, "user_id": 100, "sizes": [...], "text": "", "date": 1549470104 }, { "id": 456239202, "album_id": 262864474, "owner_id": -177279513, "user_id": 100, "sizes": [...], "text": "", "date": 1549470117 }, { "id": 456239204, "album_id": 262864474, "owner_id": -177279513, "user_id": 100, "sizes": [...], "text": "", "date": 1549470122 }]}} An example of its production:
$album_info = json_decode(file_get_contents("https://api.vk.com/method/photos.get?owner_id=-177279513&album_id={$album_id}&count=10000&access_token={$standalone_token}&v=5.92")); How I went through ...
foreach($album_info as $vs) { foreach($vs['items'] as $qs) { $result = 'photo'.$qs['owner_id'].'_'.$qs['id']; file_put_contents($config['album_1'], $result."\n", FILE_APPEND | LOCK_EX); } }