PHP自然排序多维数组

时间:2016-03-02 03:55:19

标签: php arrays multidimensional-array

我坚持这个问题:我想订购数组,这样当我遍历foreach循环时,它自然地被[name]字段排序(即12 VAC,32 VDC,120 VAC而不是12 VAC, 120 VAC,32 VDC)。任何帮助将不胜感激。

Array ( 
    [6] => WP_Term Object ( 
        [term_id] => 2320 
        [name] => 12 VAC
        [taxonomy] => pa_voltage 
     ) 

    [11] => WP_Term Object ( 
        [term_id] => 2058 
        [name] => 32 VDC 
        [taxonomy] => pa_voltage 
    ) 

    [13] => WP_Term Object ( 
        [term_id] => 300 
        [name] => 120 VAC 
        [taxonomy] => pa_voltage  
    ) 
)

0 个答案:

没有答案