Tag Archives: php seconds ago

PHP: How To Get A Time Difference in Human Readable Format

A simple function to return the time since a given timestamp in the past. function time_since($timestamp) { // Init $hash = array(); $now = time(); // Breakdown the time diff $diff = $now – $timestamp; $hash['day'] = floor($diff / 86400); … Continue reading

Tagged , , , | 1 Comment