How to sort array key based on two key values?
<p>Let's say I need to run a for loop through an array where I need to check against to key value. I would like to print the array element that doesn't match BEFORE the element that doesn't match.</p>

<p>So using the array from below (extra values added for clarity), I would like it to print as follows. It needs to match the <code>current_tag</code> and <code>last_tag</code> values. If they don't match, that key needs to be printed prior to the others.</p>

<p><strong>Desired results</strong></p>

<pre><code>TEST2

TEST1 
TEST3 
TEST4 
</code></pre>

<p><strong>Array</strong></p>

<pre><code>array(2) {
    [0]=&gt;
    array(3) {
        ["name"]=&gt;
            string(3) "TEST1"
        ["current_tag"]=&gt;
            string(13) "20121129_TEST1"
        ["last_tag"]=&gt;
            string(13) "20121129_TEST1"
    }
    [1]=&gt;
    array(3) {
        ["name"]=&gt;
            string(3) "TEST2"
        ["current_tag"]=&gt;
            string(13) "20121205_TEST2"
        ["last_tag"]=&gt;
            string(13) "20121129_TEST2"
    }
    ...
    ...
    ...
    ...
}
</code></pre>
