我想按字母順序使用PHP排序函數對數組進行排序。排序數組不工作
Array ([0] => Open Sans [1] => Wellfleet [2] => Rambla [3] => Dosis [4] => Noto Sans [5] => Domine [6] => Signika Negative [7] => Arvo [8] => Neuton [9] => Rufina [10] => Tinos [11] => Podkova [12] => Magra [13] => Bitter [14] => Anton [15] => Libre Baskerville [16] => Tienne [17] => Roboto [18] => Ruda [19] => Merriweather [20] => Amaranth [21] => Playfair Display SC [22] => Cinzel Decorative [23] => Nobile [24] => Volkhov [25] => Nunito [26] => Merriweather Sans [27] => Stardos Stencil [28] => Bree Serif)
我已經試過這一個
$heading_fonts = sort($heading_fonts);
最後我結合陣列來獲得相同的密鑰和值。
$heading_fonts = array_combine($heading_fonts, $heading_fonts);
但給我一個錯誤。
Warning: array_combine() expects parameter 1 to be array, boolean given in...
任何想法如何排序數組的工作?
'array_combine($ heading_fonts,$ heading_fonts);'這是一個數組與自身的結合。你在這條線上究竟想做什麼? – TecBrat