PHP code example of martinjoiner / ordinal-number
1. Go to this page and download the library: Download martinjoiner/ordinal-number library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
martinjoiner / ordinal-number example snippets
// Tell our code to use the namespace
use MartinJoiner\OrdinalNumber\OrdinalNumber;
// The following line will output 'three hundred seventy eighth'
print OrdinalNumber::convert( 378 );
// The following line will output 'three hundred and seventy eighth'
print OrdinalNumber::convert( 378, true );
// The following line will output 'Three hundred and seventy eighth' (notice capitalised)
print OrdinalNumber::convert( 378, true, true );
phpunit --bootstrap vendor/autoload.php tests/OrdinalNumberTest