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

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

Add Ordinal Suffix PHP Function

Add Ordinal Suffix PHP Function Usage/Testing

Output:

Share this post

22 Comments

  1. Did the job for me – exactly what I was looking for. Thanks guys

    Reply
  2. Thanks you, it’s really good

    Reply

Submit a Comment

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