title: Accessing the Key values of objects in an Array Converted from JSON
body: <p>I have this JSON string:</p>
  
  <pre><code>"Filters": [
     {"IsActive" : "1"},
     {"Gender" : "M"}
  ]
  </code></pre>
  
  <p>That I'm converting into an array <code>$filters</code>. When I <code>var_dump</code> I get:</p>
  
  <pre><code>array(2) {
    [0]=&gt;
    array(1) {
      ["IsActive"]=&gt;
      string(1) "1"
    }
    [1]=&gt;
    array(1) {
      ["Gender"]=&gt;
      string(1) "M"
    }
  }
  </code></pre>
  
  <p>I am trying to access the Key / Value pairs. The Keys are not always <code>Gender</code>, or <code>IsActive</code>. They can be anything, with any value.</p>
  
  <pre><code> foreach ($filters as $key =&gt; $value) {
     echo "\nFilter: " . $key . " =&gt; " . $value;
   }
  </code></pre>
  
  <p>But it outputs:</p>
  
  <blockquote>
    <p>Filter: Array => Array<br /> <b>Notice</b>:  Array to string
    conversion in</p>
  </blockquote>
  
  <p><strong>Why am I unable to access the k/v pairs?</strong></p>