In the function below a possible output maybe
1 day and 2 hours and 34 minutes
My question is how do I edit the implode so it will output
1 day, 2 houts and 34 minutes
This is my function
function time_difference($endtime){
$hours = (int)date("G",$endtime);
$mins = (int)date("i",$endtime);
// join the values
$diff = implode(' and ', $diff);
if (($hours == 0 ) && ($mins == 0)) {
$diff = "few seconds ago";
}
return $diff;
}