标签:
function urltest(){ $url=‘http://121.43.153.80:8983/solr/collection1/select?q=+searchkey%3a%E4%BC%9A%E8%AE%A1&fq=cityid:73&start=0&rows=3&wt=json&indent=true&group=true&group.field=courseid‘; // 1. 初始化 $ch = curl_init(); // 2. 设置选项,包括URL curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); // 3. 执行并获取HTML文档内容 $output = curl_exec($ch); // 4. 释放curl句柄 curl_close($ch); $result= json_decode($output); $jarray=$result->grouped->courseid->groups; dump($jarray[0]); }
标签:
原文地址:http://www.cnblogs.com/panqingqiang/p/5039554.html