I am trying to convert a long datatype data to time in which I am successful.
In each session time array I have values like ["1276999","787878","677267"]
. I passed this array in the array_map
function and converted to time which is working.
Now within the the convert_time
function I am calling another function, using array_map
which will convert each time (i.e 1:40:00 to 100 minutes
) but the issue is my 2nd array map function which is giving me error that array_map needs 2nd parameter to be an array...
$each_session_time = array();
for ($i=0; $i<sizeof($array_in_time_str) ; $i++) {
$each_session_time[$i]=$array_out_time_str[$i]-$array_in_time_str[$i];
}
//session time in hours
array_map("convert_to_time", $each_session_time);
function convert_to_time($each_session) {
# code...
$each_sess_time=array();
$each_sess_time=date("H:i:s",$each_session);
array_map("get_minutes",$each_sess_time);
return $each_sess_time;
}
function get_minutes($session_time) {
// algorithm to convert each session time to minutes)
}