/** * 组装报文 * @param unknown_type $params * @return string */ function getRequestParamString($params) {     $params_str = '';     foreach ( $params as $key => $value ) {         $params_str .= ($key . '=' . (!isset ( $value ) ? '' : urlencode( $value )) . '&');     }     return substr ( $params_str, 0, strlen ( $params_str ) - 1 ); } 使用 ~~~ $params = array ( "seller_email" =>'jqiang3@gail.com', "notify_url" =>'127.0.0.1', ); echo getRequestParamString($params); ~~~ 输出 ~~~ seller_email=jqiang3%40gail.com¬ify_url=127.0.0.1 ~~~