Answer the question
In order to leave comments, you need to log in
How to parse VKontakte photos?
<?php
$wall = file_get_contents(" api.vk.com/method/wall.get?v=5.3&filter=others&dom... ");
$wall = json_decode($wall);
$wall = $wall->response->items;
for ($i = 0; $i < count($wall); $i++) {
echo " ".($i + 1)." . ".$wall[$i]->text." ".date( "Ymd H:i:s", $wall[$i]->date)."";
foreach ($wall as $keys) {
print_r($keys);// $keys ;
}
}
?>
can anyone tell me? how to display photos
Answer the question
In order to leave comments, you need to log in
the for loop is out of place here, you can get rid of it, it’s enough to use for each to sort through $wall as $key
there you are interested in attachments c type=photo inside the copy_history element,
there you can choose what size the image needs, it’s still simple =)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question