st, nd, rd, th to Number
Add st, nd, rd, th to any particular number
Copy this code and paste it in your HTML
function ordinal($n) {
$r = array('st','nd','rd'); $es = (($sln < 11 || $sln > 19) && $ln > 0 && $ln < 4);
return $n . ($es ? $r[$ln - 1] : 'th');
}
Report this snippet
Comments
Subscribe to comments