if ($this->checkbox->selected){
$offset=200;
$count=200;
}else{
$offset=0;
}
$group=$this->edit7->text;
$token=$this->edit4->text;
$count=$this->edit9->text;
$h = file_get_contents("https://api.vk.com/method/market.get?owner_id=-$group&offset=$offset&count=$count&access_token=$token&v=5.59");
$array = json_decode($h,true);
$this->edit->text=$array['response']['items'][0]['title'];
$this->textArea->text=$array['response']['items'][0]['description'];
$this->edit6->text=$array['response']['items'][0]['price']['currency']['name'];
$this->edit3->text=$array['response']['items'][0]['category']['name'];
$this->edit5->text=$array['response']['items'][0]['thumb_photo'];
$this->editAlt->text=(int)$array['response']['items'][0]['price']['text'];
$array['response']['items'][0]
foreach( $array['response']['items'] as $n => $item) {
$this->edit->text = $item['title'];
$this->textArea->text = $item['description'];
$this->edit6->text = $item['price']['currency']['name'];
$this->edit3->text = $item['category']['name'];
$this->edit5->text = $item['thumb_photo'];
$this->editAlt->text = (int)$item['price']['text'];
// output current version of $this
}