Skip to content

Instantly share code, notes, and snippets.

View Vyygir's full-sized avatar

Matt Royce Vyygir

View GitHub Profile
@Vyygir
Vyygir / time_elapsed_string.php
Last active February 10, 2017 10:06 — forked from zachstronaut/gist:1184831
Get a relative time string in PHP without a lot of if/else or switch/case
<?php
/**
* time_elapsed_string()
*
* @author Zachary Johnson
* @link http://www.zachstronaut.com/posts/2009/01/20/php-relative-date-time-string.html
*
* @author Vyygir
* @link https://gist.github.com/Vyygir/5a70d8007141cf49541b967c8e9a2280
* @description I had to modify this slightly from the previous version, as it was causing errors