PHP code example of coolert / number_in_chinese

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

    

coolert / number_in_chinese example snippets


use Coolert\NumberInChinese\Convert;
$convert = new Convert();
echo $response;

$response = $convert->convertNumbers('1234567890');

一亿二千三百四十五万七千八百九十

string convertNumbers(string $number, int $dic = 1, int $unit_dic = 1)

public function index(Convert $convert)
{
    $response = $convert->convertNumbers('123457890');
}

public fuction index()
{
    $response = app('convert')->convertNumbers('123457890');
}