使用Json p查询Json-带有geting输出的probloms

使用Json p查询Json-带有geting输出的probloms,json,api,jquery,getjson,Json,Api,Jquery,Getjson,您好,我正在尝试从每个“项目名称”和“平均价格”中检索每个对象/项目的内部价格。。。 我无法从json中检索到任何东西,我相信我的调用或工作中缺少了某些东西 var url = "http://www.numbeo.com//api/city_prices?api_key=lnu_se_713&query=vaxjo"; var src; $.getJSON(url+ "&format=json&jsoncallback=?" , function (d

您好,我正在尝试从每个“项目名称”和“平均价格”中检索每个对象/项目的内部价格。。。 我无法从json中检索到任何东西,我相信我的调用或工作中缺少了某些东西

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);

        });
    });
通常我只想预订3件商品 (“廉价餐厅餐”、“麦当劳套餐”、“国产啤酒”)作为餐桌头,并附加在其上作为valeus的平均价格

请帮助我

$json\u string=”https://www.numbeo.com/api/city_prices?api_key=enter  键=恩特斯市”;
$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>
        ';
        }
$jsondata=file\u get\u contents($json\u string); $obj=json_decode($jsondata,true); foreach($obj['prices']作为$results) { 回声' “.$results['item_name']” “.$results[‘最低价格’]” “.$results[“最高价格”]” “.$results[“平均价格”]” '; }
为什么使用
数据[]
?简单的
data.prices
但当我试图检索:data.prices.average\u prices时,它不起作用,我试图提醒它并获取eror令牌丢失了
data[]的确切含义。
的意思是什么?。如果要获取数组,只需使用它的名称
数据。