code: public static function getQuery($name = '', $defaultValue = null)
      {
          $queryStringParts = [];
          if (isset($_SERVER['QUERY_STRING'])) {
              parse_str($_SERVER['QUERY_STRING'], $queryStringParts);
          }
          if ($name != '') {
              if (isset($queryStringParts[$name])) {
                  return $queryStringParts[$name];
              } else {
                  return $defaultValue;
              }
          }
          return $queryStringParts;
      }
docs: Get query.
  
  @param string $name Default '' which means all.
  @param mixed $defaultValue Default null.
  @return array|mixed