K
K
KronosHD2015-07-18 13:20:18
PHP
KronosHD, 2015-07-18 13:20:18

How to get something from an array?

$people = @file_get_contents("http://api.vk.com/method/users.get?v=5.3&user_ids=1&fields=photo_200_orig"); // Отправляем запрос
$people = json_decode($people, 1);# Разбиение на массивы

How to get first_name now?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Krupnov, 2015-07-18
@KronosHD

$people = @file_get_contents("http://api.vk.com/method/users.get?v=5.3&user_ids=1&fields=photo_200_orig"); // Отправляем запрос
$people = json_decode($people, 1);# Разбиение на массивы
echo $people['response'][0]['first_name'];

B
Baha Rustamov, 2015-07-19
@by133312

<?
  $userGet = file_get_contents("https://api.vk.com/method/users.get?fields=photo_200&uid=1");
  $json_user = json_decode($userGet,1);
  $uid = $json_user["response"][0]["uid"]; // ID юзера
  $photo_200 = $json_user["response"][0]["photo_200"]; // Фотка юзера
  $last_name = $json_user["response"][0]["first_name"].' '.$json_user["response"][0]["last_name"]; // Фамилия Имя юзера
?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question