PHP arrays & keys - fetching particular ones
<p>Lets say I have an array with a structure like this:</p>

<pre><code>$arr= Array(
    array(
    "id"=&gt;"a"
    "type"&gt;"apple"),

    array(
    "id"=&gt;"b"),

    array(
    "id"=&gt;"c"),

    array(
    "id"=&gt;"c"
    "type"=&gt;"banana")
);
</code></pre>

<p>now I want to have a foreach loop which fetches all the array elements which have a key in them named "type".</p>

<p>Something like</p>

<pre><code>foreach(all arrays which have type in them as $item)
</code></pre>

<p>How would I do that?</p>

<p>many thanks.</p>
