Hello! The question is:

It is necessary to identify friends of a VK user who liked him on a photo.

VK API offers the following methods suitable for this: 1) Collection of a list of friends (an array in the form of user IDs) 2) Collection of likes under all photos (also in the form of an array with user IDs)

Question: With what operation can you determine who is from the general list of friends, put a Like? Can compare these two arrays and if the same id's are found to output them? But with what function? Waiting for suggestions!

    1 answer 1

    You need to make requests to both methods, form two arrays of id, and then use the array_intersect function to find the id, which is in both lists.

    • Well, what about the array from "2)"? After all, a person can like several photos and then his ID will be repeated several times in the second array, But I still need to know not only who liked, but how many times - Coffee inTime