index.search_face人脸搜索
1请求网址
http://你的域名.com/api.php?api=index.search_face
2请求方式
POST
3请求参数
4返回结果
5调用示例
$apikey='xxx';
$url="http://www.monxin.com/api.php?api=api.php?api=index.search_face";
$return='json';
$array=array(
	'photo'=>'',		//base64图片数据
	
);
$re=monxin_api($apikey,$return,$url,$array);

if($re['err_code']!=0){
	//调用有误
	echo $re['err_msg'];
	exit;
}
if($re['api_state']=='fail'){
	//API业务请求失败
	echo $re['api_msg'];
	exit;
}
if($re['api_state']=='success'){
	//API业务请求成功,可在此处理业务逻辑
		
}

function monxin_api($apikey,$return,$url,$array){
	$ch = curl_init();
	$array['apikey']=$apikey;
	curl_setopt ($ch, CURLOPT_URL, $url.'&return='.$return);
	
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($array));
	curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
	$r = curl_exec($ch);
	echo $r;
	if($return=='xml'){
		$r = simplexml_load_string($r, 'SimpleXMLElement', LIBXML_NOCDATA);
		$r = json_encode($r);
	}
	$r = json_decode($r,true);
	return $r;
} 
本页由《梦行文档》生成

 

name完成
30