note 78587 deleted from function.date by derick

From: Date: Sun, 09 Dec 2007 13:38:01 +0000
Subject: note 78587 deleted from function.date by derick
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-133000@lists.php.net to get a copy of this message
Note Submitter: kangaroo232002 at yahoo dot co dot uk ---- Just a quick note on Josh L's implementation, switch doesn't pick up differences of '0' (or false) so if you are sending an email out at the same time as posting something, it will give you just a date (in the default) rather than a cute string. So, just add a catch at the top like <?php if($diff === 0) { return "just now"; } else { <do everything else> } ?> otherwise thanks josh for a v useful function :)

« previous php.notes (#133000) next »