привет, я пытаюсь извлечь из http://www.numbeo.com//api/city_prices?api_key=lnu_se_713&query=vaxjo каждое "item_name" и "average_price" из каждого объекта/предмета внутри цены... я не я не могу ничего извлечь из json, и я верю, что чего-то не хватает в моем вызове или worng
var url = "http://www.numbeo.com//api/city_prices?api_key=lnu_se_713&query=vaxjo";
var src;
$.getJSON(url+ "&format=json&jsoncallback=?" , function (data) {
$.each(data[].prices.average_price, function (i, item) {
alert(object.prices.average_price);
});
});
evually, я бы хотел, чтобы presnet только 3 предмета ("Meal Inexpensive Restaurant", "Combo Meal at McDonalds", "Домашнее пиво") в качестве столов и добавление к ним цены в качестве валеуса.
пожалуйста помогите
$json_string ="https://www.numbeo.com/api/city_prices?api_key=enter key=entes city";
$jsondata = file_get_contents($json_string);
$obj = json_decode($jsondata,true);
foreach($obj['prices'] as $results)
{
echo '<tr>
<td>'.$results['item_name'].'</td>
<td>'.$results['lowest_price'].'</td>
<td>'.$results['highest_price'].'</td>
<td>'.$results['average_price'].'</td>
';
}
data[]
? простоdata.prices