就这些,自己用的
<?php
header("Content-type: text/html; charset=utf-8");
date_default_timezone_set('PRC');
set_time_limit(0);
if (!empty($GLOBALS['HTTP_RAW_POST_DATA']))
{
$json = isset($GLOBALS['HTTP_RAW_POST_DATA']) ? $GLOBALS['HTTP_RAW_POST_DATA'] : file_get_contents("php://input");
}
//$json='{"type":"weizhang","name":"苏N12345","code":"1234"}';
$json=iconv('UTF-8', 'UTF-8//IGNORE', $json);
$json=urldecode($json);
$array2=json_decode($json, true);
$str_json_data='';
if($array2['type']=="weizhang")
{
$str_json='';
$name=substr($array2['name'],4);
$url = 'http://www.sqjg.net/Jgcx/DEFAULT.ASPX';
$data = array ('__msg' => '14,3,69;Jgcx.VehDetailxhr4,7,2,4,10,28;args'.$array2['name'].'02'.$array2['code'].'$'.$name.$array2['code'].'$<'.substr($name,0,1).'><'.substr($name,1,1).'><'.substr($name,2,1).'><'.substr($name,3,1).'><'.substr($name,4,1).'><'.substr($array2['code'],0,1).'><'.substr($array2['code'],1,1).'><'.substr($array2['code'],2,1).'><'.substr($array2['code'],3,1).'>');
$data = http_build_query($data);
$opts = array (
'http' => array (
'method' => 'POST',
'header'=> "Content-type: application/x-www-form-urlencoded\r\n" .
"Content-Length: " . strlen($data) . "\r\n".
"cookie:ASP.NET_SessionId=fohp5j45rldj2v55yz0mx445;cookie2=c2\r\n",
'content' => $data
)
);
$ctx = stream_context_create($opts);
$html = @file_get_contents($url,'',$ctx);
$html=substr($html,10);
$html=str_replace("'",'"',$html);
$array=json_decode($html, true);
$str_json="{\"yxqz\":\"".$array['YXQZ']."\",\"zt\":\"".$array['ZT']."\",\"RegisteredNo\":\"".$array['RegisteredNo']."\",\"gxrq\":\"".$array['GXRQ']."\",\"name\":\"".$array2['name']."\",\"code\":\"".$array2['code']."\",\"data\": [";
$url = 'http://www.sqjg.net/Jgcx/DEFAULT.ASPX';
$data = array ('__msg' => '11,3,19;Jgcx.getVioxhr4,7,2;args'.$array2['name'].'02');
$data = http_build_query($data);
$opts = array (
'http' => array (
'method' => 'POST',
'header'=> "Content-type: application/x-www-form-urlencoded\r\n" .
"Content-Length: " . strlen($data) . "\r\n".
"cookie:ASP.NET_SessionId=fohp5j45rldj2v55yz0mx445;cookie2=c2\r\n",
'content' => $data
)
);
$ctx = stream_context_create($opts);
$html = @file_get_contents($url,'',$ctx);
$html=substr($html,11);
$html=str_replace("]]",']',$html);
$html=str_replace("'",'"',$html);
$html='{"aa":"bb","data":['.$html.']}';
$html=iconv('UTF-8', 'UTF-8//IGNORE', $html);
$array=json_decode($html, true);
$result=$array['data'];
for($i=0;$i<count($result);$i++){
$str_json_data.=',{"reason":"'.$result[$i][0].'",
"time":"'.$result[$i][1].'",
"place":"'.$result[$i][2].'",
"code":"'.$result[$i][3].'",
"find":"'.$result[$i][4].'",
"findtime":"'.$result[$i][5].'",
"findtype":"'.$result[$i][6].'",
"code2":"'.$result[$i][7].'",
"points":"'.$result[$i][8].'",
"money":"'.$result[$i][9].'"
}';
}
$str_json_data=mb_substr($str_json_data,1);
echo $str_json.$str_json_data.']}';
}
?>