首頁 > php教程 > PHP源码 > 主體

高考成绩查询接口

PHP中文网
發布: 2016-05-25 17:11:00
原創
2527 人瀏覽過


agent = "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5";
	$snoopy->referer = "http://www.haedu.gov.cn/hadoe_plus/gk_cx/query.aspx" ;
	$action = "http://www.heao.gov.cn/PZQuery/PZCJQuery.aspx";
	$snoopy->submit($action,$frm);

	$dom = str_get_html( $snoopy->results ) ;

	if( count( $dom->find( 'p.result span#ErrorMSG' ) ) == 1 ){

		$response->status 	=	'failed' ;
		$response->msg 		=	$dom->find( 'p.result span#ErrorMSG', 0 )->text() ;
		echo json_encode( $response ) ;

	}else{

		$tbl = $dom->find( 'p.result p.queryresult table', 0 ) ;
		$response->status 	=	'success' ;
		$data = array(
				'id_card' 	=> $tbl->find( "td.common", 2)->text() ,
				'name' 		=> $tbl->find( "td.common", 3)->text() ,
				'yuwen' 	=> $tbl->find( "td.common", 4)->text() ,
				'shuxue'	=> $tbl->find( "td.common", 5)->text() ,
				'yingyu'	=> $tbl->find( "td.common", 6)->text() ,
				'zonghe'	=> $tbl->find( "td.common", 7)->text() ,
				'zongfen'	=> $tbl->find( "td.common", 8)->text() ,
				'tingli' 	=> $tbl->find( "td.common", 9)->text() ,
			);

		$response->data = $data ; 
		echo json_encode( $response ) ;
	}
登入後複製


相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
作者最新文章
最新問題
熱門推薦
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!