query information (php)

Each Core Reporting API response contains an object that contains all the query parameter values used to create the response. The metrics and sort parameters are returned as values in a list, while the other parameters are returned as strings.

private function printQueryParameters(&$results) {
  $query = $results->getQuery();

  $html = \'
\';
  foreach ($query as $paramName => $value) {
    $html .= \"$paramName = $value\\n\";
  }
  $html .= \'
\';

  print $html;
}