well... that only works if your using times and not with numbers...
i think something like this would do the trick:
function returnNumb($number)
{
$temp=substr($number, -1);
switch($temp)
{
case "1":
return $number."st";
break;
case "2":
return $number."nd";
break;
case "3":
return $number."rd";
break;
default:
return $number."th";
break;
}
}