Answer the question
In order to leave comments, you need to log in
Instagram API combine data into one object?
I get two images by tag
$json = file_get_contents("https://api.instagram.com/v1/tags/ТУТмойТег/media/recent?access_token=tokenHere&count=1");
$json2 = file_get_contents("https://api.instagram.com/v1/tags/ТУТмойТег/media/recent?access_token=tokenHere&count=1");
$data = json_decode($json);
$data2 = json_decode($json2);
$images = array();
$captions = array();
$links = array();
$photoNameWithHashtags = array();
$photoName = array();
$hashTags = array();
foreach($temp as $user_data ) {
$images[] = (array) $user_data->data->images;
$links[] = $user_data->data->link;
$captions[] = $user_data->caption;
$hashTags[] = $user_data->tags;
}
$standard = array_map( function( $item ) {
return $item['standard_resolution']->url;
}, $images );$standard = array_map( function( $item ) {
return $item['standard_resolution']->url;
}, $images );
$temp[0]=$data->data;
$temp[1]=$data2->data;
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