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.
So using the array from below (extra values added for clarity), I would like it to print as follows. It needs to match the current_tag and last_tag values. If they don't match, that key needs to be printed prior to the others.
Desired results
TEST2
TEST1
TEST3
TEST4
Array
array(2) {
[0]=>
array(3) {
["name"]=>
string(3) "TEST1"
["current_tag"]=>
string(13) "20121129_TEST1"
["last_tag"]=>
string(13) "20121129_TEST1"
}
[1]=>
array(3) {
["name"]=>
string(3) "TEST2"
["current_tag"]=>
string(13) "20121205_TEST2"
["last_tag"]=>
string(13) "20121129_TEST2"
}
...
...
...
...
}