定制 imahmood/persian-text 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

imahmood/persian-text

最新稳定版本:v2.0.0

Composer 安装命令:

composer require imahmood/persian-text

包简介

A lightweight library for persian language localization.

README 文档

README

Latest Stable Version GitHub Tests Action Status Total Downloads License

PersianText is a lightweight library for persian language localization.

Requirements

  • PHP 8.1 or greater
  • intl PHP extension

Installation

You can install this package via Composer:

$ composer require imahmood/persian-text

Usage

$string = '0123456789 - ۰١٢٣٤٥٦٧٨٩ - ي ك ة';

echo PersianText::text($string);
output: ۰۱۲۳۴۵۶۷۸۹ - ۰۱۲۳۴۵۶۷۸۹ - ی ک ه

echo PersianText::onlyArabicChars($string);
output: 0123456789 - ۰۱۲۳۴۵۶۷۸۹ - ی ک ه

echo PersianText::onlyNumbers($string);
output: ۰۱۲۳۴۵۶۷۸۹ - ۰۱۲۳۴۵۶۷۸۹ - ي ك ة

echo PersianText::toEnglishNumber($string);
output: 0123456789 - 0123456789 - ي ك ة

echo PersianText::money('123456789');
output: 123٬456٬789

echo PersianText::asSpellout(123456);
output: صد و بیست و سه هزار و چهارصد و پنجاه و شش

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 12.69k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-04-27