PHP code example of swordying / num2rmb

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

    

swordying / num2rmb example snippets


// 引入类文件
 默认 []
$config = [
    'start_mark' => '¥', ## 开始标志 默认:人民币
    'end_mark' => '正', ## 结束标志 默认:整
    'negative_mark' => '欠', ## 负数标志 默认:负
];
// 实例化
$numb2rmb = new \Swordying\num2rmb($config);

$number = 123456789.01;
$result = $numb2rmb -> handle($number);

echo $result; ## ¥壹亿贰仟叁佰肆拾伍万陆仟柒佰捌拾玖元零壹分