[php-src] Issue #22091: my codes
[email protected] (kwabenankrumah966-cloud) Tue, 19 May 2026 11:58:53 +0000
| Newsgroups | php.bugs |
|---|---|
| Message-ID | <[email protected]> |
Issue: https://github.com/php/php-src/issues/22091
Author: kwabenankrumah966-cloud
From manual page: https://php.net/function.floor
Helper function
function time_elapsed_string($datetime) {
if (empty($datetime)) return 'N/A';
$time = strtotime($datetime);
$diff = time() - $time;
if ($diff < 60) return $diff . ' seconds ago';
if ($diff < 3600) return floor($diff / 60) . ' mins ago';
if ($diff < 86400) return floor($diff / 3600) . ' hours ago';
return date('M d, Y', $time); pls i want to know if it's good or not pls
---