<?php
// $test就是你从数据库里取出的数据
$test = array('3/1', '3/2', '3/3', '3/4', '3/5', '3/5', '3/6', '3/7', '3/8', '3/9', '3/10', '3/11', '3/12', '3/13');
natsort($test);
foreach ($test as $key => $value) {
echo $value ."<br>";
}
?>
// $test就是你从数据库里取出的数据
$test = array('3/1', '3/2', '3/3', '3/4', '3/5', '3/5', '3/6', '3/7', '3/8', '3/9', '3/10', '3/11', '3/12', '3/13');
natsort($test);
foreach ($test as $key => $value) {
echo $value ."<br>";
}
?>
select 端口,replace(端口,'/','0')+0 as p from table order by p
就是先将串化为数字然后排序