php loop array multidimensional : <p>I have an array which keeps on getting bigger and dynamic. For example it looks like:-</p>

<pre><code>array(0 =&gt; 'transactions' =&gt;array(0 =&gt; array('paymentid' =&gt; abcd, 'amount' =&gt;-3), 1 =&gt; array('paymentid' =&gt; ab, 'amount' =&gt; 4)) 1 =&gt;'transactions' =&gt;array(0 =&gt; array('paymentid' =&gt; ab, 'amount' =&gt;-3), 1 =&gt; array('paymentid' =&gt; ab, 'amount' =&gt; 4))
</code></pre>

<p>Now how do I loop through them so to get amount where Payment Id is ab and amount is positive. I want to get them in this form:-</p>

<pre><code>array(0 =&gt; array('amount' =&gt; 4), 1 =&gt; array('amount' =&gt; 4))
</code></pre>

<p>I tried few methods but I couldnt loop more than 0 :(</p>
