PHP sort 2d array in alphabetischer Reihenfolge verschachtelte Wert

Ich habe ein PHP-array, dass wie folgt aussieht:

Array{
    [0] {
        'id'       => '0',
        'title'    => 'foo',
        'address'  => '123 Somewhere',
    }
    [1] {
        'id'       => '1',
        'title'    => 'bar',
        'address'  => '123 Nowhere',
    }
    [2] {
        'id'       => '2',
        'title'    => 'barfoo',
        'address'  => '123 Elsewhere',
    }
    [3] {
        'id'       => '3',
        'title'    => 'foobar',
        'address'  => '123 Whereabouts',
    }
}

und ich will Art, die es durch das 'title' - Taste in das verschachtelte arrays wie folgt Aussehen:

Array{
    [1] {
        'id'       => '1',
        'title'    => 'bar',
        'address'  => '123 Nowhere',
    }
    [2] {
        'id'       => '2',
        'title'    => 'barfoo',
        'address'  => '123 Elsewhere',
    }
    [0] {
        'id'       => '0',
        'title'    => 'foo',
        'address'  => '123 Somewhere',
    }
    [3] {
        'id'       => '3',
        'title'    => 'foobar',
        'address'  => '123 Whereabouts',
    }
}

Den ersten level-Taste Werte keine Rolle, da ich die Strecke jedes verschachtelte array über die verschachtelten key 'id'.

Ich habe schon mit ksort (), aber ohne Erfolg.

InformationsquelleAutor melat0nin | 2012-03-26
Schreibe einen Kommentar