src/Http/Request.php
public static function buildQueryString(array $data = null, $urlEncode = true)
    {
        if ($data === null) {
            $data = static::$get;
        }

        $query = [];

        foreach ($data as $name => $value) {
            $query[] = "{$name}=" . ($urlEncode ? urlencode($value) : $value);
        }

        if (count($query)) {
            return '?' . implode('&', $query);
        }
    }
public static function buildQueryString(array $data = null, $urlEncode = true)
    {
        if ($data === null) {
            $data = static::$get;
        }

        $query = [];

        foreach ($data as $name => $value) {
            $query[] = "{$name}=" . ($urlEncode ? urlencode($value) : $value);
        }

        if (count($query)) {
            return '?' . implode('&', $query);
        }
    }
public static function buildQueryString ( array $ data = null , $ urlEncode = true ) { if ( $ data === null ) { $ data = static :: $ get ; } $ query = [ ] ; foreach ( $ data as $ name => $ value ) { $ query [ ] = "{$name}=" . ( $ urlEncode ? urlencode ( $ value ) : $ value ) ; } if ( count ( $ query ) ) { return '?' . implode ( '&' , $ query ) ; } }
Builds a query string, including the question mark.

@param array $data

@return string
Builds a query string including the question mark .