Array ([0] = = Array ([ID] [receive_id] = [Mac] = + a4:3d: 78:fc:49:50 [Staytime] = [1] = = Array ([id] = [rece IVE_ID] [mac] = a4:3d:78:fc:49:51 [Staytime] [2] = = Array ([id] [receive_id] = [Mac] = a4:3d:78:fc:49:50 [Stayti Me] = 2443) [3] = = Array ([id] = [receive_id] = 42 [ MAC] = a4:3d:78:fc:49:50 [Staytime] = 1443) [4] = = Array ([id] + 2 4 [receive_id] [mac] = a4:3d:78:fc:49:51 [Staytime] + 1143) [ 5] = = Array ([id] [receive_id] = [Mac] = a4:3d:78:fc:49:51 [Staytime] => 543))
For example, the above array is differentiated by Mac
Array ([a4:3d:78:fc:49:50] + = array ([id] = [receive_id] = [m] AC] = a4:3d:78:fc:49:50 [Staytime] = [Timmarr] + = Array ( [0] = = Array ([id] = [recei VE_ID] = [Mac] = a4:3d:78:fc:49:50 [Staytime] + 400 ) [1] = = Array ([id] = = [receive_id] [mac] = a4:3d:78:fc:49:50 [Staytime] = 2443) [2] = = Array ( [ID] [receive_id] = [Mac] = A4:3d:78:fc:49:50 [Staytime] = 1443))) [a4:3d:78:fc:49:51] = = Array ([id] [[receive_id] = [Mac] = a4:3d:78:fc:49:51 [Staytime] = [Timmarr] = = Array ([0] = = Array ([id] [receive_id] = 42 [Mac] + a4:3d:78:fc:49:51 [staytime] = 200) [1] = = Array ([id] = 24 [receive_id] [mac] = a4:3d:78:fc:49:51 [Staytime] => ; 1143) [2] = = Array ([id] = 25 [receive_id] [mac] = a4:3d:78:fc:49:51 [s Taytime] + 543))))
----------------------
PHP Code:
$MACARR = [];
$MACUSERARR = [];
for ($i =0; $i < $countList; $i + +) {
if (!in_array ($list [$i] [' mac '], $MACARR)} {
$MACARR [] = $list [$i] [' mac '];
$MACUSERARR [$list [$i] [' mac ']] = $list [$i];
$MACUSERARR [$list [$i] ' mac ']][' Timmarr ' [] = $list [$i];
}else{
$MACUSERARR [$list [$i] ' mac ']][' Timmarr ' [] = $list [$i];
}
}
Less cycle times
PHP Data optimization