Answer the question
In order to leave comments, you need to log in
How to output users.get users?
I make a request:
$user = json_decode(file_get_contents("https://api.vk.com/method/users.get?user_ids={$'users_id'}&name_case=acc&v=5.67"), true);
$users = '<a href="//vk.com/id'.$usersad['response'][0]['id'].'" target="_blank" >'.$usersad['response'][0]['first_name'].' '.$usersad['response'][0]['last_name'].'</a>';
Answer the question
In order to leave comments, you need to log in
Well, what result did you expect without a cycle? ) It is necessary for each element in the response to go through and get ids, and then work with an array of ready-made code.
I'm new to php, but $users should be an array, i.e. not $users = code, but:
for(i = 0; i == что-то.length; i++){
$users[i] = '<a href="//vk.com/id'.$usersad['response'][i]['id'].'" target="_blank" >'.$usersad['response'][i]['first_name'].' '.$usersad['response'][i]['last_name'].'</a>';
i++;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question