Last active
November 19, 2020 14:33
-
-
Save makingthingswork/a3333df365f3dcca4f30460ae7a5ef7c to your computer and use it in GitHub Desktop.
Get number as ordinal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Returns the number as an ordinal eg. 1st, 2nd, 3rd, 4th etc. | |
function nth(num) { | |
nf = new NumberFormatter('en_GB', NumberFormatter::ORDINAL); | |
return nf->format(num); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment