wernerdweight/stringy

通用增强型异常,可用于其他项目

1.0.0 2023-02-21 18:45 UTC

This package is auto-updated.

Last update: 2024-09-21 22:16:33 UTC


README

具有一致和可预测API的PHP Stringy对象

Build Status Latest Stable Version Total Downloads License

安装

  1. 使用composer下载
composer require wernerdweight/stringy
  1. 在项目中使用
use WernerDweight\Stringy\Stringy;

$stringy = new Stringy('This is a string');
echo $string
    ->toLowercase()    // this is a string
    ->replace(' ', '-')    // this-is-a-string
    ->convertCase(Stringy::KEBAB, Stringy::PASCAL)   // ThisIsAString
    ->reverse();    // gnirtSAsIsihT

API

待办事项