Piwik\API\Request::getRequestParametersGET PHP Method

getRequestParametersGET() public static method

Returns the original request parameters in the current query string as an array mapping query parameter names with values. The result of this function will not be affected by any modifications to $_GET and will not include parameters in $_POST.
public static getRequestParametersGET ( ) : array
return array
    public static function getRequestParametersGET()
    {
        if (empty($_SERVER['QUERY_STRING'])) {
            return array();
        }
        $GET = UrlHelper::getArrayFromQueryString($_SERVER['QUERY_STRING']);
        return $GET;
    }

Usage Example

Example #1
0
 /**
  * Returns the segment query parameter from the original request, without modifications.
  *
  * @return array|bool
  */
 public static function getRawSegmentFromRequest()
 {
     // we need the URL encoded segment parameter, we fetch it from _SERVER['QUERY_STRING'] instead of default URL decoded _GET
     $segmentRaw = false;
     $segment = Common::getRequestVar('segment', '', 'string');
     if (!empty($segment)) {
         $request = Request::getRequestParametersGET();
         if (!empty($request['segment'])) {
             $segmentRaw = $request['segment'];
         }
     }
     return $segmentRaw;
 }