I
I
Ilya Korablev2015-04-29 19:40:25
PHP
Ilya Korablev, 2015-04-29 19:40:25

How to define an image?

Hello.
Here is a method in VK API - wall.get .
How in PHP to make it so that it is determined if the image is then , and if the audio is then Push on the idea of ​​\u200b\u200bimplementation. <img src=""/><audio src=""/>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladlen Grachev, 2015-04-29
@gwer

In items->attachments is an array of objects. Each of the objects has a type field, which has a value, for example, audio or photo, depending on the type. This value uniquely determines the type and, accordingly, the required tag. No problems either.

D
Dmitry Skogorev, 2015-04-29
@EnterSandman

parse the API response
if the photo array exists - display its contents in a loop, say with photo_75
if the audio array exists - display the contents of the url
or do you completely chew it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question