Tôi đã tạo ra một chức năng không dựa vào chức năng
printf["The %s hour.\n", ordinal[0]]; // The 0th hour.
printf["The %s ossicle.\n", ordinal[1]]; // The 1st ossicle.
printf["The %s cat.\n", ordinal[12]]; // The 12th cat.
printf["The %s item.\n", ordinal[-23]]; // The -23rd item.
0 của PHP vì nó không cần thiết, nhưng cũng làm cho nó nhỏ gọn và ngắn như tôi nghĩ hiện tại là có thể.Mã: [tổng cộng 121 byte]: [121 bytes total]
function ordinal[$i] { // PHP 5.2 and later
return[$i.[[$j=abs[$i]%100]>10&&$j0&&$j10 && $j10&&$j10&&$j10&&$j