|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
没有人会喜欢和见异思迁的人交朋友,因为这种人太不安分,太不可靠,因此,你必须要强迫自己完成自己的目标,哪怕可能会很难受,也得坚持,毅力就是这么锻炼出来的。
$money = array (
0 =>array ( 'money' => '21', 'time' => '2012-10-18', ),
1 =>array ( 'money' => '28', 'time' => '2012-10-17', ),
2 =>array ( 'money' => '92', 'time' => '2012-10-16', ),
3 =>array ( 'money' => '428', 'time' => '2012-10-15', ),
4 =>array ( 'money' => '776', 'time' => '2012-10-14',),
5 =>array ( 'money' => '298', 'time' => '2012-10-13',),
7 =>array ( 'money' => '112', 'time' => '2012-10-11',),
8 =>array ( 'money' => '199', 'time' => '2012-10-10',),
);
$money2 = array (
0 =>array ( 'gamemoney' => '2', 'time' => '2012-10-16',),
1 =>array ( 'gamemoney' => '50', 'time' => '2012-10-13',),
2 =>array ( 'gamemoney' => '75', 'time' => '2012-10-12',),
);
require('Debug.php' );
foreach ($money as &$val ){
$val['gamemoney']='';
}
foreach ($money2 as & $val2){
$val2['money']='';
}
$times=array ();
foreach ($money as $key => $val3){
array_push($times,$val3['time']);
}
foreach ($money2 as $key => $val4){
if (in_array( $val4[ 'time'], $times)){
$money_key = array_search( $val4[ 'time'], $times);
$money[$money_key ]['gamemoney' ] = $val4 ['gamemoney' ];
}else{
array_push($money, array( 'gamemoney'=> $val4[ 'gamemoney'], 'time'=> $val4[ 'time'], 'money'=> '') );
}
}
foreach($money as $aaaaa){
$timeaa[]=$aaaaa['time'];
}
array_multisort($timeaa,SORT_DESC, $money);
Zend_Debug::dump ($money );
数组 php array_multisort处置 本文链接http://www.cxybl.com/html/wlbc/Php/20130504/37474.html在这里想谈谈自己这六个多月的PHP学习心得,希望对给比我还新的新手们有所帮助,讲的不是很深刻,甚至有的想法可能是错误的,希望不要误导新人才好,大家要有自己的主见。 |
|