code: private function __getQueryString($queryAr = array(), $prefixIfNotEmpty = '')
      {
          $queryAr = array_filter($queryAr);
          array_walk($queryAr, function (&$val, $key) {
              $val = urlencode($key) . '=' . urlencode($val);
          });
  
          return $queryAr ? $prefixIfNotEmpty . join('&', $queryAr) : '';
      }
docs: Convert query array to encoded query string.
  
  @param array $queryAr
  @param string $prefixIfNotEmpty
  @return string