$content = file_get_contents($siteurl);
$data = json_decode($content);
echo $data[0]->title." ".$data[0]->showinfo[0]->time;
资料都出不来,是用法有错误吗?
用print_r显示$data的结果(只贴上第一笔)
Array
(
[0] => stdClass Object
(
[version] => 1.4
[UID] => 526aa481e44da0ea8d4168c4
[title] => 2014TIFA-拉布兰之心人声音乐会
[category] => 1
[showInfo] => Array
(
[0] => stdClass Object
(
[time] => 2014/03/07 19:30:00
[location] => 台北市中山南路21-1号
[locationName] => 国家演奏厅
[onSales] => Y
[price] => 400,500
[latitude] => 25.0348366
[longitude] => 121.5176314
)
[1] => stdClass Object
(
[time] => 2014/03/08 19:30:00
[location] => 台北市中山南路21-1号
[locationName] => 国家演奏厅
[onSales] => Y
[price] => 400,500
[latitude] => 25.0348366
[longitude] => 121.5176314
)
)
[showUnit] =>
[discountInfo] =>
[descriptionFilterHtml] =>
[imageUrl] =>
[masterUnit] => Array
(
[0] => 国立中正文化中心
)
[subUnit] => Array
(
[0] =>
)
[supportUnit] => Array
(
[0] =>
)
[otherUnit] => Array
(
[0] => 主要艺文支持:JTI
)
[webSales] =>
http://www.artsticket.com.tw/CKSCC2005/Product/Product00/ProductsDetailsPage.aspx?ProductID=oK4bYlG1GfzBcHkQto2QJ
[sourceWebPromote] => http://tifa.ntch.edu.tw/
[comment] =>
[editModifyDate] => 2013/10/28 14:46:13
[sourceWebName] => 两厅院售票网
[startDate] => 2014/03/07
[endDate] => 2014/03/08
[status] => success
[total] => 111
)