Ich habe eine PHP-Array, das wie folgt aussieht:PHP Art 2d Array alphabetisch nach verschachtelten Wert
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 möchte es sortieren durch die ‚title‘ Schlüssel in den verschachtelten 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',
}
}
die erste Ebene wichtige Werte sind nicht wichtig, da ich über den verschachtelten Schlüssel ‚id‘ Spur jeden verschachtelten Array zu halten.
Ich habe mit ksort() gespielt, aber ohne Erfolg.
möglich Duplikat [PHP Art mehrdimensionales Array von Wert] (http://stackoverflow.com/questions/2699086/php-sort- multidimensional-array-by-value) –