0
我必須按照存儲在內部數組中一個字段(笑話)上的字符串的長度對二元數組排序。按字符串長度對三維數組進行排序PHP
Array(
'type' => 'success',
'value => array (
0 => array (
'id' => 1
'joke' => 'Chuck Norris uses ribbed condoms inside out, so he gets the pleasure.');
1 => array (
'id' => 2
'joke' => 'MacGyver can build an airplane out of gum and paper clips. Chuck Norris can kill him and take it.');
);
);
我已經tryed幾個方面,但如果你需要使用非平凡的比較一個不錯的選擇將是使用usort()
數組進行排序,我不能得到它的權利
,所以你要排序只是'joke'鍵嵌套數組? – RomanPerekhrest