$apiVK = "https://api.vk.com/method";
$method = "users.get";
$fields = "photo_max";
$go = curl ("$apiVK/$method?fields=$fields&v=5.52&access_token=".$accTok);
{"response":[{"uid":7460897,"first_name":"Олег","last_name":"Карпов","photo_200_orig":"https:\/\/pp.userapi.com\/c848628\/v848628939\/8e487\/V2ogGLL2Otw.jpg?ava=1","online":0,"user_id":7460897}]}
<<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>PROBA</title>
</head>
<body>
<button id="load">Показать</button>
<ul></ul>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.2.js "></script>
<script>
$('#load').on('click', loadFriends);
function getUrl(method, params) {
if (!method) throw new Error('НЕ УКАЗАН МЕТОД!');
params = params || {};
params["access_token"] = 'aafa2d2bb5693c84e65375db709da03a1a9b3fa7c52cc06624adc55edf7ebb724837b4a04794815';
return 'https://api.vk.com/method/' + method + '?' + $.param(params) + '&v=5.52';
}
function sendRequest(method, params, func) {
$.ajax({
url: getUrl(method, params),
method: 'GET',
dataType: 'JSONP',
success: func
});
}
function loadFriends () {
sendRequest('friends.search', {count: 60, fields: 'photo_100'}, function (data) {
drawFriends(data.response);
});
}
function drawFriends(friends) {
var html = '';
for (var i = 0; i < friends.length; i++) {
var f = friends [i];
html +=
'<li>'+
'<a target="_blank" href="vk.com/id'+ f.id +'">'
+ '<img scr="'+ f.photo_100 +'" />'
+ '<div>'
+ '<h4>' + f.first_name + ' ' + f.last_name + '</h4>'
+ '<button>Написать</button>'
+ '</div>'
+ '</a>'
+ '</li>';
}
$('ul').html(html);
}
</script>
</body>
</html>