Revision: 28083
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at June 30, 2010 15:47 by galofre
Initial Code
function ordinal($n) { $ln = (int) substr($n, -1); $sln = (int) substr($n, -2); $r = array('st','nd','rd'); $es = (($sln < 11 || $sln > 19) && $ln > 0 && $ln < 4); return $n . ($es ? $r[$ln - 1] : 'th'); }
Initial URL
Initial Description
Add st, nd, rd, th to any particular number
Initial Title
st, nd, rd, th to Number
Initial Tags
Initial Language
PHP