<?php require_once 'curl.func.php'; $appkey = 'your_appkey_here';//你的appkey $type = 'C1';// 驾照类型 A1,A3,B1,A2,B2,C1,C2,C3,D,E,F $subject = 1;// 1:科目一 4:科目四 $pagenum = 1; $pagesize = 20; $sort = 'normal';// normal:顺序查询 rand:随机查询 $url = "https://api.jisuapi.com/driverexam/query?appkey=$appkey&type=$type&subject=$subject&pagenum=$pagenum&pagesize=$pagesize&sort=$sort"; $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['total'].' '.$result['pagenum'].' '.$result['pagesize'].' '.$result['subject'].' '.$result['type'].' '.$result['sort']; foreach($result['list'] as $val) { echo $val['question'].' '.$val['option1'].' '.$val['option2'].' '.$val['option3'].' '.$val['option4'].' '.$val['answer'].' '.$val['explain'].' '.$val['pic'].'
'; }
© 2015-2024 杭州极速互联科技有限公司 版权所有 浙ICP备17047587号-4 浙公网安备33010502005096 增值电信业务经营许可证:浙B2-20190875