<?php
$fpt = file_get_contents('https://api.vk.com/method/photos.get?owner_id=-1766&album_id=2629&count=1000&access_token=***&v=5.50');
$jjs = json_decode($fpt);
$jrnd = $jjs->response->count;
$jrnd = rand('0',$jrnd);
$pid = $jjs->response->items[$jrnd]->id;
file_get_contents('https://api.vk.com/method/wall.post?owner_id=-182&access_token=***&v=5.50&from_group=1&attachment=photo-1766_'.$pid);
?>