note 11333 added to String functions
| From: | oliver dot white at blibbleblobble dot co dot uk | Date: | Fri, 16 Feb 2001 10:35:16 +0000 |
| Subject: | note 11333 added to String functions | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-11142@lists.php.net to get a copy of this message | ||
Regarding your requests on ordinal numbers, the date functions may be useful:
date("S",mktime(0,0,0,1,$x,1970));
Formatting a date as "S" gives the ordinal of it's day, i.e "21 march"
would give "st"
mktime takes the parameters (h,m,s,m,d,y) - note the order. Jan n'th 1970 is a convenient way
of converting an integer to a date.
http://www.php.net/manual/en/ref.strings.php