oranfry/english-lists
最新稳定版本:1.0.0
Composer 安装命令:
composer require oranfry/english-lists
包简介
README 文档
README
This library enables you to render a PHP array as an English-language list.
For example, the array ['A', 'B', 'C', 'D'] becomes string 'A, B, C, and D'.
You can designate an alternative to the "and" (such as "or").
You can also turn off the oxford comma.
Installation
composer require oranfry/english-lists
Usage
use EnglishLists\EnglishLists; $myArray = ['Blood', 'Toil', 'Tears', 'Sweat']; echo EnglishLists::render( $myArray, // the array to render 'or', // the final separator (default: and) false, // don't use an oxford comma (default: use oxford comma) ); // Blood, Toil, Tears or Sweat echo EnglishLists::render(['One']); // One echo EnglishLists::render(['One', 'Two']); // One and Two echo EnglishLists::render(['One', 'Two', 'Three']); // One, Two, and Three
统计信息
- 总下载量: 22
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2024-11-15