首页 车型大全 车型大全示例代码 根据车型获取车[PHP]

根据车型获取车示例代码[PHP]

作者: 阅读数:1264 上传时间:

根据车型获取车

<?php

require_once 'curl.func.php';

$appkey = 'your_appkey_here';//你的appkey
$parentid = 220;//品牌ID
$url = "https://api.jisuapi.com/car/car?parentid=$parentid&appkey=$appkey";
$result = curlOpen($url, ['ssl'=>true]);
$jsonarr = json_decode($result, true);
//exit(var_dump($jsonarr));
if($jsonarr['status'] != 0)
{
    echo $jsonarr['msg'];
    exit();
}

$result = $jsonarr['result'];

echo $result['id'].' '.$result['name'].' '.$result['initial'].' '.$result['fullname'].' '.$result['depth'].' '.$result['logo'].' '.$result['salestate'].'
';//车信息,3级 foreach($result['list'] as $vv) { echo $vv['id'].' '.$vv['name'].' '.$vv['logo'].' '.$vv['price'].' '.$vv['yeartype'].' '.$vv['productionstate'].' '.$vv['salestate'].' '.$vv['sizetype'].'
';//车信息,4级 }