定制 bitandblack/sentence-construction 二次开发

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

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

bitandblack/sentence-construction

最新稳定版本:2.2.0

Composer 安装命令:

composer require bitandblack/sentence-construction

包简介

Creates nice sentences out of arrays

README 文档

README

PHP from Packagist Latest Stable Version Total Downloads License

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-06-21