时间:2021-07-01 10:21:17 帮助过:34人阅读
$curlPost='key='.urlencode($key);
$ch=curl_init();
curl_setopt($ch,CURLOPT_URL,'http://www.cits-sz.net/api/index.php');
curl_setopt($ch,CURLOPT_HEADER,0);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_POSTFIELDS,$curlPost);
$data=curl_exec($ch);
curl_close($ch);
echo json_decode($data,true);
$s = '{"11":{"l_id":"11","l_title":"CITS-香港观光一天游【品质纯玩】"},"12":{"l_id":"12","l_title":"test"}}';
print_r(json_decode($s,1));
Array
(
[11] => Array
(
[l_id] => 11
[l_title] => CITS-香港观光一天游【品质纯玩】
)
[12] => Array
(
[l_id] => 12
[l_title] => test
)
)