public static function buildQuery($queryData)
    {
        $query = '';
        // Loop through all of the $query_data
        foreach ($queryData as $key => $value) {

            // If the value is an array, we will end up recursing
            if (is_array($value)) {
                // Loop through the values
                foreach ($value as $value2) {
                    // Add an arg_separator if needed
                    if ($query !== '') {
                        $query .= '&';
                    }
                    // Recurse
                    $query .= self::buildQuery(array($key => $value2));
                }
            } else {
                // Add an arg_separator if needed
                if ($query !== '') {
                    $query .= '&';
                }
                // Add the key and the urlencoded value (as a string)
                $query .= $key . '=' . urlencode((string) $value);
            }
        }
        return $query;
    }