我有这个代码,我需要按字母顺序排序。有什么帮助吗?
$first = JHTML::_('select.option', 0, _JSHOP_SEARCH_ALL_MANUFACTURERS, 'manufacturer_id', 'name');
$_manufacturers = JTable::getInstance('manufacturer', 'jshop');
$manufacturers = $_manufacturers->getList();
array_unshift($manufacturers, $first);
$list_manufacturers = JHTML::_('select.genericlist', $manufacturers, 'manufacturer_id', 'class = "inputbox" size = "1"','manufacturer_id','name' );
答案 0 :(得分:0)
使用排序
对数组进行排序sort($manufacturers);