I need help..
Is there a function in PHP or Postgresql that converts cardinal numbers (1,2,3, etc) to ordinal numbers in the form 1st, 2nd, 3rd and so on...?
thanks a lot in advance...
http://www.php.net/manual/en/function.date.php
i belive a capitol "S" is the code for the date.
so if your date was in a unixtime format in a variable called $somedate, then you could do this:
<? echo date("F dS",$somedate); ?>
F is the month spelt out d is the number of the day and S is what you are looking for. the suffix for the appropriate number.
Well, actually, my hunch is you are NOT working with dates. I could be wrong.
I found some code that "almost" works, at this location (when you get there, scroll about a 3rd [no pun intended] of the way down)
http://216.239.39.100/search?q=cache:VqlSRgr1h64C:php.mweb.co.id/manual/en/ref.strings.php+php+1st+2nd+3rd+ordinal&hl=en&ie=UTF-8
However, I noticed that the function works fine.... until you get above 100. 111 turns into 111st.......112 turns into 112nd
But you can fiddle with the code to fix that...