How can I implement the trend-oriented implementation of the domestic version? Share To: ------ solution -------- implement trend-oriented release
How can I achieve the trend of implementing the domestic version?
Share:
------ Solution --------------------
// First, the uid is used as the key. This should be done when the data is generated
$ Old_rank = array (
132 => array ('uid' => 132, 'Use _ score '=> 61570 ),
121 => array ('uid' => 121, 'Use _ score '=> 50932 ),
145 => array ('uid' => 145, 'Use _ score '=> 46789 ),
100 => array ('uid' => 100, 'Use _ score '=> 39089 ),
167 => array ('uid' => 167, 'Use _ score '=> 29089)
);
$ New_rank = array (
132 => array ('uid' => 132, 'Use _ score '=> 61570 ),
145 => array ('uid' => 145, 'Use _ score '=> 51932 ),
121 => array ('uid' => 121, 'Use _ score '=> 50932 ),
167 => array ('uid' => 167, 'Use _ score '=> 40089 ),
100 => array ('uid' => 100, 'Use _ score '=> 39089)
);
Foreach ($ new_rank as $ k => $ v)
$ Res [$ k] = $ v ['use _ score ']-$ old_rank [$ k] ['use _ score'];
Print_r ($ res );
Array
(
[132] => 0
[1, 145] => 5143
[121] => 0
[1, 167] => 11000
[100] => 0
)