index.reg_user 新增会员
1请求网址
http://www.你的域名.com/api.php?api=index.reg_user
2请求方式
POST
3请求参数
4返回结果
5调用示例
$apikey=require('./apikey.php');
$url="http://www.monxin.com/api.php?api=index.reg_user";
$return='xml';
$array=array(
	'username'=>'张三丰',
	'email'=>'zsf@qq.com',
	'phone'=>'19899000099',
	'nickname'=>'张三丰',
	'password'=>'你猜',
	'transaction_password'=>'你猜',
	'icon'=>'http://qzapp.qlogo.cn/qzapp/101035582/78924A0CE1EBE9B9B2F660DC18E6CDF1/100',
	'money'=>102,
	'credits'=>12,
);
$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_URL, 'http://sms.yunpian.com/v2/sms/single_send.json');
	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;
}



本页由《梦行文档》生成