PHP code example of earpengai / convert-to-khmer

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

    

earpengai / convert-to-khmer example snippets


composer 

use ConvertToKhmer\NumberToKhmerWords;

$NumberToKhmerWord = new NumberToKhmerWords();

$NumberToKhmerWord->numberToWord(123456789); //មួយរយម្ភៃបីលានបួនសែនប្រាំម៉ឺនប្រាំមួយពាន់ប្រាំពីររយប៉ែតសិបប្រាំបួន
$NumberToKhmerWord->accNumberToWord(123456789); //មួយរយម្ភៃបីលានបួនរយហាសិបប្រាំមួយពាន់ប្រាំពីររយប៉ែតសិបប្រាំបួន

NumberToKhmerWords::instance()->numberToWord(987654321); //ប្រាំបួនរយប៉ែតសិបប្រាំពីរលានប្រាំមួយសែនប្រាំម៉ឺនបួនពាន់បីរយម្ភៃមួយ
NumberToKhmerWords::instance()->accNumberToWord(987654321); //ប្រាំបួនរយប៉ែតសិបប្រាំពីរលានប្រាំមួយរយហាសិបបួនពាន់បីរយម្ភៃមួយ