您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

求一段优雅高效的数组排序算法

2025/9/12 4:04:21发布18次查看
原代码:
$web =list::model()->findall(array(condition=>id = 8},order=>id asc));$webs='';foreach($web as $k=>$v){ foreach($v as $ks=>$vs){ $webs[$k][$ks]=$vs; }}response::json($webs);

求一段优雅高效的数组排序算法。
貌似最简单的是:
$web =list::model()->findall(array(condition=>id = 8},order=>id asc));response::json(json_decode(cjson::encode($web),true));

不知道这么转换会不会有其它问题?
回复内容: 原代码:
$web =list::model()->findall(array(condition=>id = 8},order=>id asc));$webs='';foreach($web as $k=>$v){ foreach($v as $ks=>$vs){ $webs[$k][$ks]=$vs; }}response::json($webs);

求一段优雅高效的数组排序算法。
貌似最简单的是:
$web =list::model()->findall(array(condition=>id = 8},order=>id asc));response::json(json_decode(cjson::encode($web),true));

不知道这么转换会不会有其它问题?
你先用markdown编辑下代码吧
我帮你展示下
php$web =list::model()->findall(array(condition=>id = 8},order=>id asc)); $webs='';foreach($web as $k=>$v){ foreach($v as $ks=>$vs){ $webs[$k][$ks]=$vs; } }response::json($webs);
http://www.cnblogs.com/imxiu/p/3474367.html
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product