If I'd like to display a given number as ordinal number, I'd do it like this:
<?php
// Needs 'php5-intl' package to be installed on Debian/Ubuntu
$set_format = numfmt_create( 'en_US', NumberFormatter::ORDINAL );
// '3' is displayed as '3rd'
echo numfmt_format( $set_format, 3 );
?>
But if I'd like to display a given number as ordinal number in word form (e.g. first, second, third, etc.) using a built-in PHP function/class like NumberFormatter
, how do I do that? Is it possible?
Related Links:
ucfirst()
or is there a built-in way? – Demogorgon