note 55646 deleted from function.strftime by derick

From: Date: Sat, 04 Nov 2006 10:42:05 +0000
Subject: note 55646 deleted from function.strftime by derick
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-119378@lists.php.net to get a copy of this message
Note Submitter: fackelkind honorsociety de ---- My last post was bullshit, i gave my first version (of course the wrong one) to you. Let me correct this: <?php function &daySufix ($dayNumber = false){ #> This function adds the 'st', 'nd', 'rd' or 'th' to a given daynumber. # (string) $dayNumber = (!$dayNumber) ? strftime ("%#d") : $dayNumber; $sufixes = Array ("1" => "st", "2" => "nd", "3" => "rd"); return (isset ($sufixes[substr ($dayNumber, -1)])) ? $sufixes[substr ($dayNumber, -1)] : "th"; } ?>

« previous php.notes (#119378) next »