August 2009
1 post
2 tags
Generate ordinal, easy way in PHP
After going through lot of custom functions for generating ordinal number in PHP, I was finally able to find the best way (so far) for doing it.
What’s happening here?
Since the PHP date function only considers valid number range from 1 to 31 for the day parameter, the modulo operator keeps it in this rang.
The number that has to be shown as the ordinal as 4th parameter to the mktime...