W
W
Whiteweb2014-11-18 21:01:52
PHP
Whiteweb, 2014-11-18 21:01:52

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

1 answer(s)
J
Jim_Di, 2014-11-27
@JimDi

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 question

Ask a Question

731 491 924 answers to any question