public to_query_string ( $options = [] ) : string | ||
return | string | 返回诸如 key1=value1&key2=value2 |
public function to_query_string($options = array())
{
$temp = array();
foreach ($options as $key => $value) {
if (is_string($key) && !is_array($value)) {
$temp[] = rawurlencode($key) . '=' . rawurlencode($value);
}
}
return implode('&', $temp);
}