title: Can't access elements in array using key
body: <p>I'm trying to get a list of all pages on a wordpress site and access their ID. I can get a list of pages using the <a href="https://codex.wordpress.org/Function_Reference/get_pages" rel="nofollow noreferrer">get_pages()</a> function. When I try to access any of the elements with their keys, it doesn't interpret.</p>
  
  <p>For example, the following code wouldn't work:</p>
  
  <pre><code>$pages = get_pages();
  
  foreach ($pages as $page) {
    $ID = $page['ID'];
  }
  </code></pre>
  
  <p>But, if I do this:</p>
  
  <pre><code>$pages = get_pages();
  
  foreach($pages as $page) {
    foreach ($page as $key =&gt; $value) {
      echo("&lt;p&gt;$key&lt;/p&gt;");
    }
  }
  </code></pre>
  
  <p>It clearly prints out ID as a valid key.</p>
  
  <p>What am I doing wrong?</p>