/ Published in: PHP

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function numerals($number) { { $lastDigit = 0; } else { } switch($lastDigit) { case 3: $numeralAppendix = 'rd'; break; case 2: $numeralAppendix = 'nd'; break; case 1: $numeralAppendix = 'st'; break; default: $numeralAppendix = 'th'; break; } return $number . $numeralAppendix; }
URL: http://snipplr.com/view/39427/make-position-number/
Comments
