В файле name_full.txt хранится содержимое:
item345, item347
item348, item349
В api ответ следующий:
{"result":{"appid":730,"contextid":"2","items":{"item345":860,"item348":2347}}}
$classid = file('name_full.txt', FILE_IGNORE_NEW_LINES);
$url = "https://site.com/api/user_api.php?request=GetLowestSalePrices&key=";
$opts = array('http'=>array('method'=>"GET",'header'=>"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36"));
$context = stream_context_create($opts);
foreach($classid as $info){
$start = @file_get_contents($url.@file_get_contents('key.txt')."&appid=730&contextid=2&names=".$info, false, $context);
$json = json_decode($start);
foreach ($json as $key => $value) { // тут возникает ошибка
foreach ($value->items as $key2 => $value2){
}
}
if (($info % 1) == 0)
{
usleep(300000);
}
}
?>