PHP code example of emirustaoglu / numbertoword

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

    

emirustaoglu / numbertoword example snippets


use emirustaoglu\numbertoword;
/**
* @param string $language  Dil kodunu belirtiniz. tr|en varsayılan tr
* @param string $langFolder Kendi dil dosyanızı kullanacaksınız tam klasör yolunu belirtiniz.
* @return void
*/
$convert = new numbertoword();
/**
@param float $sayi   Yazıya çevrilecek rakamı iletiniz. Örn: 99.99
@param int $kurusbasamak Kuruş hanesinin kaç basamak olacağını beliriniz. Örn: 2 
@param string $parabirimi    Çevrilecek parabirimini belirtiniz. Varsayılan TRY | Desteklenen para birimleri için getCurrencyType() fonksiyonunu kullanabilirsiniz.
@return string
*/
$numberToWord = $convert->convert(999.99, 3, "TRY");

echo $numberToWord;

//Parametre verilmez ise varsayılan dil türkçedir. 
$convert = new numbertowords("en");


return [
    'b1' => ["", "BİR", "İKİ", "ÜÇ", "DÖRT", "BEŞ", "ALTI", "YEDİ", "SEKİZ", "DOKUZ"],
    'b2' => ["", "ON", "YİRMİ", "OTUZ", "KIRK", "ELLİ", "ALTMIŞ", "YETMİŞ", "SEKSEN", "DOKSAN"],
    'b3' => ["", "YÜZ", "BİN", "MİLYON", "MİLYAR", "TRİLYON", "KATRİLYON"],
];

/**
* @param string $language  Dil kodunu belirtiniz. tr|en varsayılan tr
* @param string $langFolder Kendi dil dosyanızı kullanacaksınız tam klasör yolunu belirtiniz.
* @return void
*/
$convert = new numbertowords("de", __DIR__ . '/lang/');