首页 电影影讯 电影影讯示例代码 按城市获取电影院[PHP]

按城市获取电影院示例代码[PHP]

作者: 阅读数:1235 上传时间:2018-07-11

按城市获取电影院

<?php

require_once 'curl.func.php';

$appkey = 'your_appkey_here';//你的appkey
$cityid = '1'; //城市ID 任选
$city = '北京'; //城市名称 任选
$keyword = '万达';
$url = "https://api.jisuapi.com/movie/theater?cityid=$cityid&city=$city&keyword=$keyword&appkey=$appkey";
$result = curlOpen($url, ['ssl'=>true]);
$jsonarr = json_decode($result, true);
if($jsonarr['status'] != 0)
{
    echo $jsonarr['msg'];
    exit();
}
$result = $jsonarr['result'];
echo $result['city'].' '.$result['cityid'].' '.$result['keyword']. '
'; foreach($result as $val) { echo $val['theaterid'].' '.$val['theatername'].' '.$val['city'].' '.$val['cityid'].' '.$val['tel'].' '.$val['address'].' '. $val['hours'].' '.$val['seatnum'].' '.$val['roomnum'].' '.$val['logo'].' '. $val['score'].' '.$val['summary'].' '.$val['lat'].' '.$val['lng']. '
'; }