= 0) { return $tense = "now"; } elseif ($difference > 0) { $tense = "ago"; } else { $tense = "later"; } for ($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) { $difference /= $lengths[$j]; } $difference = round($difference); $period = $periods[$j] . ($difference >1 ? "s" :''); return "{$difference} {$period} {$tense} "; } ?>

Saved ยท bytes