bitandblack/sentence-construction
最新稳定版本:2.2.0
Composer 安装命令:
composer require bitandblack/sentence-construction
包简介
Creates nice sentences out of arrays
README 文档
README
Sentence construction
Creates nice sentences out of arrays.
Installation
This library is made for the use with Composer. Add it to your project by running $ composer require bitandblack/sentence-construction.
Usage
Create a sentence like that:
<?php
use BitAndBlack\SentenceConstruction;
$fruits = [
'Apples',
'Bananas',
'Pears'
];
$sentence = new SentenceConstruction(
glue: ', ',
glueLast: ' and ',
pieces: $fruits,
);
var_dump('I like ' . $sentence);
This will dump I like Apples, Bananas and Pears.
The SentenceConstruction class provides the method getSentence but is also stringable by itself, so you can simply echo it.
Help
If you have any questions, feel free to contact us under hello@bitandblack.com.
Further information about Bit&Black can be found under www.bitandblack.com.
统计信息
- 总下载量: 125.99k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-06-21