Original code:
$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);
Find an elegant and efficient array sorting algorithm.
It seems that the simplest is:
I wonder if there are any other problems with this conversion?
Reply content:
Original code:
$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);
Find an elegant and efficient array sorting algorithm.
It seems that the simplest is:
I wonder if there are any other problems with this conversion?
You should edit the code with Markdown.
I'll show you the next one.
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