7 Star 19 Fork 7

王东祥/HongYuDSC

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
code_select.php 1.10 KB
一键复制 编辑 原始数据 按行查看 历史
鸿宇科技 提交于 2018-03-02 02:43 . Initial commit
<?php
//zend by QQ:1527200768 鸿宇科技 禁止倒卖 一经发现停止任何服务
function createParam($paramArr, $showapi_secret)
{
$paraStr = '';
$signStr = '';
ksort($paramArr);
foreach ($paramArr as $key => $val) {
if (($key != '') && ($val != '')) {
$signStr .= $key . $val;
$paraStr .= $key . '=' . urlencode($val) . '&';
}
}
$signStr .= $showapi_secret;
$sign = strtolower(md5($signStr));
$paraStr .= 'showapi_sign=' . $sign;
echo '排好序的参数:' . $signStr . "<br>\r\n";
return $paraStr;
}
header('Content-Type:text/html;charset=UTF-8');
date_default_timezone_set('PRC');
$showapi_appid = 'xxxxxx';
$showapi_secret = 'xxxxxxxxx';
$paramArr = array('showapi_appid' => $showapi_appid, 'code' => '');
$param = createparam($paramArr, $showapi_secret);
$url = 'http://route.showapi.com/66-22?' . $param;
echo '请求的url:' . $url . "<br>\r\n";
$result = file_get_contents($url);
echo "返回的json数据:<br>\r\n";
print($result . '<br>\\r\\n');
$result = json_decode($result);
echo "<br>\r\n取出showapi_res_code的值:<br>\r\n";
print_r($result->showapi_res_code);
echo "<br>\r\n";
?>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/doney/HongYuDSC.git
git@gitee.com:doney/HongYuDSC.git
doney
HongYuDSC
HongYuDSC
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385