ikwattro/string-object

使用对象进行字符串操作

1.1.0 2016-12-23 21:15 UTC

This package is not auto-updated.

Last update: 2024-09-14 19:47:53 UTC


README

使用对象进行PHP字符串操作。

获取它

composer require ikwattro/string-object

示例

$code = StringObject::newInstance("Toys - Bicycles and Bikes - 12398")
    ->split("-")
    ->last()
    ->trim();`

# 12398
$formatted = StringObject::newInstance("Christmas is on 25/12")
    ->toLower()
    ->replace("/","-");

# christmas is on 25-12

许可证

MIT