title: Rename array result
body: <pre><code>&lt;?php
  
  function getResults($analytics) {
  
    $SecondaryParams = array('dimensions' =&gt; 'ga:date,ga:ProductName,ga:transactionId,ga:campaign,ga:sourceMedium');
  
  return $analytics-&gt;data_ga-&gt;get(
  
         'ga:xxxxxxxx',
         '2022-01-01',
         'today',
         'ga:itemQuantity,ga:sessions',
   $SecondaryParams);
  }
  
  function printResults($results) {
    // Parses the response from the Core Reporting API and prints
    // the profile name and total sessions.
    if (count($results-&gt;getRows()) &gt; 0) {
  
      // Get the profile name.
      $profileName = $results-&gt;getProfileInfo()-&gt;getProfileName();
  
      // Get the entry for the first entry in the first row.
      $rows = $results-&gt;getRows();
      $sessions = $rows[0][0];
      // Print the results.
      print &quot;First view (profile) found: $profileName\n&quot;;
      print &quot;Total sessions: $sessions\n&quot;;
    } else {
      print &quot;No results found.\n&quot;;
    }
  }
  </code></pre>
  <p>how can i change the name of each result in this aray</p>
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [0] =&gt; 20220101
              [1] =&gt; Product
              [2] =&gt; 2139814
              [3] =&gt; SS-All products
              [4] =&gt; facebook
              [5] =&gt; 1
              [6] =&gt; 0
          )
  </code></pre>
  <p>ex: <code>[0]</code> to <code>[name]</code></p>