uasort() ? - sorting posts from a bank account
<p>How can I sort an array with some posts from a bank account?</p>

<p>I need to sort by three fields: date, amount, accumulated amount</p>

<p>ie.</p>

<pre><code>date | amount | accum_amount
01-01-11 500 500 ('amount' + previous 'accum_amount' = 'accum_amount' =&gt; 500 + 0 = 500)
01-01-11 100 600 ('amount' + previous 'accum_amount' = 'accum_amount' =&gt; 100 + 500 = 600)
01-02-11 -25 575 ('amount' + previous 'accum_amount' = 'accum_amount' =&gt; -25 + 600 = 575)
01-02-11 150 725 ('amount' + previous 'accum_amount' = 'accum_amount' =&gt; 150 + 575 = 725)
01-03-11 200 925 ('amount' + previous 'accum_amount' = 'accum_amount' =&gt; 200 + 725 = 925)
01-04-11 -25 900 ('amount' + previous 'accum_amount' = 'accum_amount' =&gt; -25 + 925 = 900)
</code></pre>

<p>btw. the date field is an UNIX timestamp</p>

<pre><code>array(
    array(
        'time' =&gt; 1200000000,
        'amount' =&gt; 500,
        'accum_amount' =&gt; 500
        ),
    array(
        'time' =&gt; 1200000000,
        'amount' =&gt; 150,
        'accum_amount' =&gt; 725
        ),
    array(
        'time' =&gt; 1200000000,
        'amount' =&gt; 100,
        'accum_amount' =&gt; 600
        ),
    array(
        'time' =&gt; 1300000000,
        'amount' =&gt; 200,
        'accum_amount' =&gt; 925
        ),
    array(
        'time' =&gt; 1300000000,
        'amount' =&gt; -25,
        'accum_amount' =&gt; 900
        ),
    array(
        'time' =&gt; 1200000000,
        'amount' =&gt; -25,
        'accum_amount' =&gt; 575
        )
    )
</code></pre>
