PHP code example of s1k3 / bangla-number-to-word

1. Go to this page and download the library: Download s1k3/bangla-number-to-word 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/ */

    

s1k3 / bangla-number-to-word example snippets


'providers' => [
    S1K3\Bangla\Number\To\Word\NumberToWordServiceProvider::class,
]

number_to_word('123', 'bn');
// একশত তেইশ টাকা

number_to_word('123', 'en');
// one hundred twenty-three taka

number_to_word('1556.62', 'bn');
// এক হাজার পাঁচশত ছাপ্পান্ন টাকা বাষট্টি পয়সা

number_to_word('15262', 'en');
// fifteen thousand two hundred sixty-two taka

// Omit language to use the default from config/number_to_word.php
number_to_word('155342262');
// পনের কোটি তিপ্পান্ন লক্ষ বিয়াল্লিশ হাজার দুইশত বাষট্টি টাকা

return [
    'language' => 'bn',   // default language: 'en' or 'bn'
    'unit' => [
        'en' => 'taka',
        'bn' => 'টাকা',
    ],
    'units' => [
        'en' => [
            'crore'    => 'crore',
            'lac'      => 'lac',
            'thousand' => 'thousand',
            'hundred'  => 'hundred',
            'paisa'    => 'cent',
        ],
        'bn' => [
            'crore'    => 'কোটি',
            'lac'      => 'লক্ষ',
            'thousand' => 'হাজার',
            'hundred'  => 'শত',
            'paisa'    => 'পয়সা',
        ],
    ],
];
bash
php artisan vendor:publish --provider="S1K3\Bangla\Number\To\Word\NumberToWordServiceProvider"