第一种
public function sortAction($data,$appSecret){
        ksort($data, SORT_STRING);
        $authURL = http_build_query($data, '', '&');
        $authURL = urldecode($authURL);
        $sign = md5($authURL.$appSecret);
        return $sign;
    }
第二种
    public function sort2Action($data,$appSecret){
        ksort($data, SORT_STRING);
        $authURL = array();
        foreach ($data as $k => $r) {
            $authURL[] = $k.'='.$r;
        }
        $authURL = implode('&', $authURL);
        //$authURL = http_build_query($post, '', '&', PHP_QUERY_RFC3986);
        $sign = md5($authURL.$appSecret);
        return $sign;
    }
Logo

DAMO开发者矩阵,由阿里巴巴达摩院和中国互联网协会联合发起,致力于探讨最前沿的技术趋势与应用成果,搭建高质量的交流与分享平台,推动技术创新与产业应用链接,围绕“人工智能与新型计算”构建开放共享的开发者生态。

更多推荐