note 97967 deleted from function.is-numeric by cmb
| From: | cmb@php.net | Date: | Sun, 23 Jun 2019 10:32:17 +0000 |
| Subject: | note 97967 deleted from function.is-numeric by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-211346@lists.php.net to get a copy of this message | ||
Note Submitter: purdue at nc dot rr dot com
----
I see a lot of examples below to get the ordinal string for a given number ("1st",
"2nd", "3rd", "4th", etc). If you only need small ordinals (up to
"31st" at most), this one-line trick works:
<?php
function ordinal ($i) {
return date("jS", strtotime("Jan $i"));
}
?>