PHP code example of andrey-helldar / digittext

1. Go to this page and download the library: Download andrey-helldar/digittext 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/ */

    

andrey-helldar / digittext example snippets


Helldar\DigitText\ServiceProvider::class,

digit_text($number = 0, string $lang = 'en', bool $is_currency = false);

(new DigitText)
    ->get($number = 0, string $lang = 'en', bool $is_currency = false);

echo digit_text(null);          // zero
echo digit_text(64.23);         // sixty four
echo digit_text(2866);          // two thousands eight hundred sixty six
echo digit_text(2866, 'ru');    // две тысячи восемьсот шестьдесят шесть

echo digit_text(0, 'en', true);     // zero dollar
echo digit_text(64.23, 'en', true); // sixty four dollars 23 cents
echo digit_text(2866, 'en', true);  // two thousands eight hundred sixty six dollars
echo digit_text(2866, 'ru', true);  // две тысячи восемьсот шестьдесят шесть руб