I have array look like below. And I want to do sum of chatduration for userwise.
And also want to count below 3 detail from status
- close_chat
- open_chat
-
total chat.
Array ( [0] => Array ( [id] => pZgauDZtvQ9grRD9c [rid] => obHEGwnrfHKCd32jF [starttime] => 14-02-2018 [chatduration] => 124.502 [username] => bhavin [status] => open ) [1] => Array ( [id] => ej5WfYe3dn8mtHzQF [rid] => o6pKCt4e6RaYiZhQ8 [starttime] => 14-02-2018 [chatduration] => 1072.628 [username] => bhavin [status] => closed ) [2] => Array ( [id] => qCzZjf7vb4rSBRndk [rid] => ZFvuuFiL9RFiemX3K [starttime] => 14-02-2018 [chatduration] => 11.254 [username] => lokesh [status] => closed ) [3] => Array ( [id] => TCdSycFFSeY8WaKzG [rid] => f7ADPWFsCD6RZFspk [starttime] => 14-02-2018 [chatduration] => 121.228 [username] => lokesh [status] => closed ) )
And from this array I want to take sum chatduration userwise. Sum of bhavin user and lokesh user should be store in array.
How can this possible?