/* 字典升序*/ function formatParaMap($paraMap) { $buff = ""; ksort($paraMap); foreach ($paraMap as $k => $v) { $buff .= $k . "=" . $v . "&"; } $reqPar = ''; //去掉最后一个字符 $ if (strlen($buff) > 0) { $reqPar = substr($buff, 0, strlen($buff)-1); } return $reqPar; }