<?php require 'curl.func.php'; $appkey = 'your_appkey_here';//你的appkey $amount = '100M';//1G请写成1024M $mobile = '15158825888'; $outorderno = ''; $areatype = ''; $appsecret = 'your_appsecret_here'; $queryarr = array('mobile'=>$mobile,'amount'=>$amount,'outorderno'=>$outorderno,'areatype'=>$areatype); $sign = makeSign($queryarr, $appsecret); $url = "https://api.jisuapi.com/flowrecharge/recharge?appkey=$appkey&mobile=$mobile&amount=$amount&outorderno=$outorderno&areatype=$areatype"; $result = curlOpen($url, ['ssl'=>true]); $jsonarr = json_decode($result, true); //exit(var_dump($jsonarr)); if($jsonarr['status'] != 0) { echo $jsonarr['msg']; exit(); } $result = $jsonarr['result']; echo $result['mobile'].' '.$result['amount'].' '.$result['outorderno'].'
'; echo $result['orderno'].' '.$result['totalfee'].' '.$result['rechargestatus'].$result['areatype'].'
'; function makeSign($queryarr, $appsecret) { ksort($queryarr, SORT_STRING); $str = implode($queryarr); $str .= $appsecret; //exit($str); $str = md5($str); return $str; }
PHP通用请求函数,CURL封装
© 2015-2025 杭州极速互联科技有限公司 版权所有 浙ICP备17047587号-4 浙公网安备33010502005096 增值电信业务经营许可证:浙B2-20190875