Keys →
Functions ↓
function ordinate ( $n, $s=false ) {#-k string format# convert a number to its ordinal string $s1 = $s2 = ''; if ($s) { $s1 = '<sup>'; $s2 = '</sup>'; } if (($n >= 11) and ($n <= 13)) { $r = 'th'; } else { $x = $n % 10; switch ($x) { case 1: $r = 'st'; break; case 2: $r = 'nd'; break; case 3: $r = 'rd'; break; default: $r = 'th'; break; } } return $n . $s1 . $r . $s2; }?>