note 42068 deleted from ref.strings by tomsommer

From: Date: Wed, 15 Sep 2004 20:46:25 +0000
Subject: note 42068 deleted from ref.strings by tomsommer
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-76781@lists.php.net to get a copy of this message
Note Submitter: billp at gol dot com ---- To add to the posts about ordinal numbers, this function takes a number and (based only on the final digit) returns the number with the ordinal suffix. <?PHP function ordinalize($number) { $driver = substr("$number", -1); switch($driver) { case '1': $number = $number . "st"; break; case '2': $number = $number . "nd"; break; case '3': $number = $number . "rd"; break; default: $number = $number . "th"; break; } return $number; } ?>

« previous php.notes (#76781) next »