/chinese-numerals

PHP Arabic numerals converted to Chinese numerals tools

Primary LanguagePHPMIT LicenseMIT

PHP Arabic numerals converted to Chinese numerals tools.

Packagist Total Downloads Build Status

Introduction

The PHP arabic numerals converted to Chinese numerals tools.

Installation

Run this command to add this library to your composer.json file:

composer require mouson/chinese-numerals

Quick Start Guide

use

use Mouson\Helpers\ChineseNumericHelper;

arabic numerals converted to lower case chinese numerals

$chinese = ChineseNumericHelper::Numeric2Chinese(123);
echo $chinese; \\ 一百二十三

arabic numerals converted to upper case chinese numerals

$chinese = ChineseNumericHelper::Numeric2Chinese(123, true);
echo $chinese; \\ 壹佰貳拾參

阿拉伯數字轉換為中文數字工具

簡介

一個阿拉伯數字轉換為中文數字的工具。

安裝

執行以下指令將此套件加入到 composer.json 檔案:

composer require mouson/chinese-numerals

使用

引用

use Mouson\Helpers\ChineseNumericHelper;

小寫中文轉換

$chinese = ChineseNumericHelper::Numeric2Chinese(123);
echo $chinese; \\ 一百二十三

大寫中文轉換

$chinese = ChineseNumericHelper::Numeric2Chinese(123, true);
echo $chinese; \\ 壹佰貳拾參