Php 事件API:搜索城市中的事件

Php 事件API:搜索城市中的事件,php,json,api,Php,Json,Api,我编写这段代码是为了使用事件api查找城市中的音乐事件 它适用于一些城市和其他城市不,我不知道为什么 它应该对所有人都有效,否则就一无所获 它对都灵、罗马、佛罗伦萨、巴黎、纽约、旧金山都适用,但对米兰和伦敦不适用。 我的意思是,在米兰,我没有得到任何结果。 json格式如下所示: {"last_item":null,"total_items":"0","first_item":null,"page_number":"1","page_size":"10","page_items":null,"s

我编写这段代码是为了使用事件api查找城市中的音乐事件

它适用于一些城市和其他城市不,我不知道为什么

它应该对所有人都有效,否则就一无所获

它对都灵、罗马、佛罗伦萨、巴黎、纽约、旧金山都适用,但对米兰和伦敦不适用。 我的意思是,在米兰,我没有得到任何结果。 json格式如下所示:

{"last_item":null,"total_items":"0","first_item":null,"page_number":"1","page_size":"10","page_items":null,"search_time":"0.16","page_count":"0","events":null} 
取而代之的是伦敦,我从网站显示的内容中得到了不同的结果

我不明白为什么?我的代码中的错误在哪里

多谢各位

$citta=urlencode("san francisco");

$eventiUrl = "http://api.eventful.com/json/events/search?app_key=XXX&category=music&location=$citta&sort_order=popularity";

$contents = file_get_contents($eventiUrl);

$eventi=json_decode($contents,true); 

foreach($eventi['events']['event'] as $event){

    echo $event['title']."<br>".$event['description']."<br>";
    echo $event['start_time']." ".$event['stop_time']."<br>";
    echo $event['venue_name']." ".$event['city_name']."<br>";
    echo "<a href=".$event['url'].">link</a><br>";
}
$citta=urlencode(“旧金山”);
$eventiUrl=”http://api.eventful.com/json/events/search?app_key=XXX&category=music&location=$citta&sort_order=popularity”;
$contents=file\u get\u contents($eventiUrl);
$eventi=json_decode($contents,true);
foreach($eventi['events']['event']作为$event){
echo$event['title']。“
”$event['description']。“
”; echo$event['start_time']。“$event['stop_time']。”
”; echo$event['vention\u name']。“$event['city\u name']。”
”; 回声“
”; }
如果我把API键换成XXX,你会看到什么?我会看到:2017-08-30 00:00:00奥斯陆伦敦自由人与晕船史蒂夫-安布莱克希斯艺术节2017-周日2017-09-10 00:00:00达特茅斯场伦敦瓦利斯阿尔卑斯山与该网站在伦敦播放的音乐不同如果我把我的API键换成XXX我得到的是:2017-08-30 00:00:00奥斯陆伦敦自由人和晕船的史蒂夫-安布莱克希斯音乐节2017-周日2017-09-10 00:00:00 Dartmouth Field London Vallis Alps不同于该网站在伦敦的音乐展示