private function httpBuildQuery($params)
    {
        $query = [];
        foreach ($params as $key => $param) {
            if (!is_array($param)) {
                continue;
            }
            // when a param has many values, it generate the query string separated to join late
            foreach ($param as $subParam) {
                $query[] = http_build_query([$key => $subParam]);
            }
            unset($params[$key]);
        }

        // join queries strings
        $query[] = http_build_query($params);
        $query = implode('&', $query);

        return $query;
    }
private function httpBuildQuery($params)
    {
        $query = [];
        foreach ($params as $key => $param) {
            if (!is_array($param)) {
                continue;
            }
            // when a param has many values, it generate the query string separated to join late
            foreach ($param as $subParam) {
                $query[] = http_build_query([$key => $subParam]);
            }
            unset($params[$key]);
        }

        // join queries strings
        $query[] = http_build_query($params);
        $query = implode('&', $query);

        return $query;
    }
private function httpBuildQuery ( $ params ) { $ query = [ ] ; foreach ( $ params as $ key => $ param ) { if ( ! is_array ( $ param ) ) { continue ; } // when a param has many values, it generate the query string separated to join late foreach ( $ param as $ subParam ) { $ query [ ] = http_build_query ( [ $ key => $ subParam ] ) ; } unset ( $ params [ $ key ] ) ; } // join queries strings $ query [ ] = http_build_query ( $ params ) ; $ query = implode ( '&' , $ query ) ; return $ query ; }
Create a query string

@param array $params
@return string
Create a query string