I have this array:
array:2 [▼
0 => array:3 [▼
"time" => 7780
"name" => "John A. Doe"
"photo" => "johndoe.png"
]
1 => array:3 [▼
"time" => 49800
"name" => "Jane B. Doe"
"photo" => "janedoe.png"
]
]
the time
value is seconds, my question is how can i loop through the array so that I can run a function like:
"time" => $this->secondsToHumanReadable(49800)
My function secondsToHumanReadable
is tested and working fine, i just want it to insert on the time
value inside my array result.
UPDATE:
Desired output will be:
array:2 [▼
0 => array:3 [▼
"time" => '2 days, 1 hour, 3 minutes, 45 seconds'
"name" => "John A. Doe"
"photo" => "johndoe.png"
]
1 => array:3 [▼
"time" => '3 hour, 15 minutes, 20 seconds'
"name" => "Jane B. Doe"
"photo" => "janedoe.png"
]
]