php 简单的 冒泡排序
<?php $data = array('1','34','21','45','63','22'); //sort($data); //print_r($data);die; $count = count($data); for($i=1;$i<$count;$i++) { for($j=0;$j< $count-$i ;$j++) { if($data[$j]<$data[$j+1]) { $str = $data[$j+1]; $data[$j+1]=$data[$j]; $data[$j]=$str; } } } print_r($data); ?>