PHPには、この種の配列があります(大きな例では申し訳ありませんが、特定の種類です):
[0] => Array
(
[title] => 1
[desc] => 2
)
[1] => Array
(
[title] => 1
[desc] => 3
)
[2] => Array
(
[title] => 1
[desc] => 2
[content] => 10
)
[3] => Array
(
[title] => 1
[desc] => 2
[content] => 11
)
[4] => Array
(
[title] => 1
[desc] => 3
[content] => 9
)
[5] => Array
(
[title] => 1
[desc] => 2
[content] => 10
[tag] => 'foo'
)
[6] => Array
(
[title] => 1
[desc] => 2
[content] => 10
[tag] => 'bar'
)
そして、私はこの出力が欲しいです:
[0] => Array
(
[title] => 1
[desc] => 2
)
[1] => Array
(
[title] => 1
[desc] => 2
[content] => 10
)
[2] => Array
(
[title] => 1
[desc] => 2
[content] => 10
[tag] => 'bar'
)
[3] => Array
(
[title] => 1
[desc] => 2
[content] => 10
[tag] => 'foo'
)
[4] => Array
(
[title] => 1
[desc] => 2
[content] => 11
)
[5] => Array
(
[title] => 1
[desc] => 3
)
[6] => Array
(
[title] => 1
[desc] => 3
[content] => 9
)
そして残念ながら、array_multisort()
キーの数が一定でない配列を並べ替えることはできません。すべての配列を無視するだけです...何か考えはありますか?