If Not True Then False

PHP 1st, 2nd, 3rd, 4th, 5th, 6th – PHP Add Ordinal Number Suffix - Comment Page: 2

This is simple function to add English ordinal number suffix after normal number. Function takes number as a parameter and returns number with suffix, like: 1st, 2nd, 3rd, 4th, 5th, 6th… This is example table of ordinal numbers 1 to 100 1st 2nd 3rd 4th 5th 6th 7th 8th 9th ...
Tagged with:


Leave a Comment

Your email address will not be published. Required fields are marked *

Input your comment.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Input your name.

Dave Morton

Thanks for the useful function. I wrote a functionally similar (but horribly ugly) function to accomplish this many years ago, but yours is by far superior, and I’ve replaced my function with yours in my snippet library. Cheers!

reply Reply