Пример #1
0
 public function createLinkstring($array, $sign = true)
 {
     //除去待签名参数数组中的空值和签名参数
     $data = CoreHelper::paraFilter($array);
     //对待签名参数数组排序
     $data = CoreHelper::argSort($data);
     //把数组所有元素,按照“参数=参数值”的模式用“&”字符拼接成字符串
     $prestr = CoreHelper::createLinkstring($data);
     if (!$sign) {
         return $prestr;
     }
     $data['sign'] = urlencode($this->sign($prestr));
     $data['sign_type'] = $this->signType;
     return CoreHelper::createLinkstring($data);
 }