ajbatac on 01/17/08
Last Edited at 01/17/08 01:25pm
function ordinalize($number) {if (in_array(($number % 100),range(11,13))){return $number.'th';}else{switch (($number % 10)) {case 1:return $number.'st';break;case 2:return $number.'nd';break;case 3:return $number.'rd';default:return $number.'th';break;}}}
Report this snippet Tweet
Comment:
You need to login to post a comment.