选择语言 :

 Core_HttpIO::query

返回query构造参数

string Core_HttpIO::query( [ array $params = null ] )

参数列表

参数 类型 描述 默认值
$params array Array of GET parameters null
返回值
  • string
File: ./core/classes/httpio.class.php
public static function query(array $params = null)
{
    if ($params === null)
    {
        // Use only the current parameters
        $params = HttpIO::GET(null, false);
    }
    else
    {
        // Merge the current and new parameters
        $params = array_merge(HttpIO::GET(null, false), $params);
    }

    if (empty($params))
    {
        // No query parameters
        return '';
    }

    $query = http_build_query($params, '', '&');

    // Don't prepend '?' to an empty string
    return ($query === '') ? '' : '?' . $query;
}