我按顺序从 db 行获取 10、12、13、21、06、02、08
我需要这样排序:02、06、08、10、12、13、21
按字段排序 ASC 不起作用我需要。我尝试删除零然后对数组进行排序,但没有结果。有什么想法吗?
欧梅里
sort(ARRAY) 成功了
$sql = "SELECT DISTINCT l, item, l, s FROM tr WHERE s = '".$_POST['size']."'  AND type = '".$type."' ORDER BY l ASC";
            $res = mysql_query($sql,$this->conn);
            $type = '<option selected="selected" disabled="disabled"></option>';
            while($row = mysql_fetch_array($res)){
                 $caption[] = $row;
            }
            sort($caption);
            foreach($caption as $row) {     
                    $length = substr($row['item'], strrpos($row['item'], '-') + 1);
                    $type .= '<option value="'.$length.'">'.$length.'</option>';
            }