复制代码 代码如下:
function array_sort($array, $key){
if(is_array($array)){
$key_array = null;
$new_array = null;
for( $i = 0; $i < count( $array ); $i++ ){
$key_array[$array[$i][$key]] = $i;
}
ksort($key_array);
$j = 0;
foreach($key_array as $k => $v){
$new_array[$j] = $array[$v];
$j++;
}
unset($key_array);
return $new_array;
}else{
return $array;
}
}
http://www.bkjia.com/PHPjc/621721.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/621721.htmlTechArticle复制代码 代码如下: function array_sort($array, $key){ if(is_array($array)){ $key_array = null; $new_array = null; for( $i = 0; $i count( $array ); $i++ ){ $key_array[$array...
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn