构造请求字符串.txt function buildQueryString($data) { $querystring = ''; if (is_array($data)) { // Change data in to postable data foreach ($data as $key = $val) { if (is_array($val)) { foreach ($val as $val2) { $querystring .= urlen
function buildQueryString($data) { $querystring = ''; if (is_array($data)) { // Change data in to postable data foreach ($data as $key => $val) { if (is_array($val)) { foreach ($val as $val2) { $querystring .= urlencode($key).'='.urlencode($val2).'&'; } } else { $querystring .= urlencode($key).'='.urlencode($val).'&'; } } $querystring = substr($querystring, 0, -1); } else { $querystring = $data; } return $querystring; } //该片段来自于http://www.codesnippet.cn/detail/1407201513081.html