![Stringy](http://danielstjules.com/github/stringy-logo.png)
A PHP string manipulation library with multibyte support. Compatible with PHP
5.4+, PHP 7+, and HHVM.
``` php
s('string')->toTitleCase()->ensureRight('y') == 'Stringy'
```
Refer to the [1.x branch](https://github.com/danielstjules/Stringy/tree/1.x) or
[2.x branch](https://github.com/danielstjules/Stringy/tree/2.x) for older
documentation.
[![Build Status](https://api.travis-ci.org/danielstjules/Stringy.svg?branch=master)](https://travis-ci.org/danielstjules/Stringy)
[![Total Downloads](https://poser.pugx.org/danielstjules/stringy/downloads)](https://packagist.org/packages/danielstjules/stringy)
[![License](https://poser.pugx.org/danielstjules/stringy/license)](https://packagist.org/packages/danielstjules/stringy)
* [Why?](#why)
* [Installation](#installation)
* [OO and Chaining](#oo-and-chaining)
* [Implemented Interfaces](#implemented-interfaces)
* [PHP 5.6 Creation](#php-56-creation)
* [StaticStringy](#staticstringy)
* [Class methods](#class-methods)
* [create](#createmixed-str--encoding-)
* [Instance methods](#instance-methods)
<table>
<tr>
<td><a href="#appendstring-string">append</a></td>
<td><a href="#atint-index">at</a></td>
<td><a href="#betweenstring-start-string-end--int-offset">between</a></td>
<td><a href="#camelize">camelize</a></td>
</tr>
<tr>
<td><a href="#chars">chars</a></td>
<td><a href="#collapsewhitespace">collapseWhitespace</a></td>
<td><a href="#containsstring-needle--boolean-casesensitive--true-">contains</a></td>
<td><a href="#containsallarray-needles--boolean-casesensitive--true-">containsAll</a></td>
</tr>
<tr>
<td><a href="#containsanyarray-needles--boolean-casesensitive--true-">containsAny</a></td>
<td><a href="#countsubstrstring-substring--boolean-casesensitive--true-">countSubstr</a></td>
<td><a href="#dasherize">dasherize</a></td>
<td><a href="#delimitint-delimiter">delimit</a></td>
</tr>
<tr>
<td><a href="#endswithstring-substring--boolean-casesensitive--true-">endsWith</a></td>
<td><a href="#endswithanystring-substrings--boolean-casesensitive--true-">endsWithAny</a></td>
<td><a href="#ensureleftstring-substring">ensureLeft</a></td>
<td><a href="#ensurerightstring-substring">ensureRight</a></td>
</tr>
<tr>
<td><a href="#firstint-n">first</a></td>
<td><a href="#getencoding">getEncoding</a></td>
<td><a href="#haslowercase">hasLowerCase</a></td>
<td><a href="#hasuppercase">hasUpperCase</a></td>
</tr>
<tr>
<td><a href="#htmldecode">htmlDecode</a></td>
<td><a href="#htmlencode">htmlEncode</a></td>
<td><a href="#humanize">humanize</a></td>
<td><a href="#indexofstring-needle--offset--0-">indexOf</a></td>
</tr>
<tr>
<td><a href="#indexoflaststring-needle--offset--0-">indexOfLast</a></td>
<td><a href="#insertint-index-string-substring">insert</a></td>
<td><a href="#isalpha">isAlpha</a></td>
<td><a href="#isalphanumeric">isAlphanumeric</a></td>
</tr>
<tr>
<td><a href="#isbase64">isBase64</a></td>
<td><a href="#isblank">isBlank</a></td>
<td><a href="#ishexadecimal">isHexadecimal</a></td>
<td><a href="#isjson">isJson</a></td>
</tr>
<tr>
<td><a href="#islowercase">isLowerCase</a></td>
<td><a href="#isserialized">isSerialized</a></td>
<td><a href="#isuppercase">isUpperCase</a></td>
<td><a href="#lastint-n">last</a></td>
</tr>
<tr>
<td><a href="#length">length</a></td>
<td><a href="#lines">lines</a></td>
<td><a href="#longestcommonprefixstring-otherstr">longestCommonPrefix</a></td>
<td><a href="#longestcommonsuffixstring-otherstr">longestCommonSuffix</a></td>
</tr>
<tr>
<td><a href="#longestcommonsubstringstring-otherstr">longestCommonSubstring</a></td>
<td><a href="#lowercasefirst">lowerCaseFirst</a></td>
<td><a href="#padint-length--string-padstr-----string-padtype--right-">pad</a></td>
<td><a href="#padbothint-length--string-padstr----">padBoth</a></td>
</tr>
<tr>
<td><a href="#padleftint-length--string-padstr----">padLeft</a></td>
<td><a href="#padrightint-length--string-padstr----">padRight</a></td>
<td><a href="#prependstring-string">prepend</a></td>
<td><a href="#regexreplacestring-pattern-string-replacement--string-options--msr">regexReplace</a></td>
</tr>
<tr>
<td><a href="#removeleftstring-substring">removeLeft</a></td>
<td><a href="#removerightstring-substring">removeRight</a></td>
<td><a href="#repeatint-multiplier">repeat</a></td>
<td><a href="#replacestring-search-string-replacement">replace</a></td>
</tr>
<tr>
<td><a href="#reverse">reverse</a></td>
<td><a href="#safetruncateint-length--string-substring---">safeTruncate</a></td>
<td><a href="#shuffle">shuffle</a></td>
<td><a href="#slugify-string-replacement-----string-language--en">slugify</a></td>
</tr>
<tr>
<td><a href="#sliceint-start--int-end-">slice</a></td>
<td><a href="#splitstring-pattern--int-limit-">split</a></td>
<td><a href="#startswithstring-substring--boolean-casesensitive--true-">startsWith</a></td>
<td><a href="#startswithanystring-substrings--boolean-casesensitive--true-">startsWithAny</a></td>
</tr>
<tr>
<td><a href="#stripwhitespace">stripWhitespace</a></td>
<td><a href="#substrint-start--int-length-">substr</a></td>
<td><a href="#surroundstring-substring">surround</a></td>
<td><a href="#swapcase">swapCase</a></td>
</tr>
<tr>
<td><a href="#tidy">tidy</a></td>
<td><a href="#titleize-array-ignore">titleize</a></td>
<td><a href="#toascii-string-language--en--bool-removeunsupported--true-">toAscii</a></td>
<td><a href="#toboolean">toBoolean</a></td>
</tr>
<tr>
<td><a href="#tolowercase">toLowerCase</a></td>
<td><a href="#tospaces-tablength--4-">toSpaces</a></td>
<td><a href="#totabs-tablength--4-">toTabs</a></td>
<td><a href="#totitlecase">toTitleCase</a></td>
</tr>
<tr>
<td><a href="#touppercase">toUpperCase</a></td>
<td><a href="#trim-string-chars">trim</a></td>
<td><a href="#trimleft-string-chars">trimLeft</a></td>
<td><a href="#trimright-string-chars">trimRight</a></td>
</tr>
<tr>
<td><a href="#truncateint-length--string-substring---">truncate</a></td>
<td><a href="#underscored">underscored</a></td>
<td><a href="#uppercamelize">upperCamelize</a></td>
<td><a href="#uppercasefirst">upperCaseFirst</a></td>
</tr>
</table>
* [Extensions](#extensions)
* [Tests](#tests)
* [License](#license)
## Why?
In part due to a lack of multibyte support (including UTF-8) across many of
PHP's standard string functions. But also to offer an OO wrapper around the
`mbstring` module's multibyte-compatible functions. Stringy handles some quirks,
provides additional functionality, and hopefully makes strings a little easier
to work with!
```php
// Standard library
strtoupper('fòôbàř'); // 'FòôBàř'
strlen('fòôbàř'); // 10
// mbstring
mb_strtoupper('fòôbàř'); // 'FÒÔBÀŘ'
mb_strlen('fòôbàř'); // '6'
// Stringy
s('fòôbàř')->toUpperCase(); // 'FÒÔBÀŘ'
s('fòôbàř')->length(); // '6'
```
## Installation
If you're using Composer to manage dependencies, you can include the following
in your composer.json file:
```json
"require": {
"danielstjules/stringy": "~3.1.0"
}
```
Then, after running `composer update` or `php composer.phar update`, you can
load the class using Composer's autoloading:
```php
require 'vendor/autoload.php';
```
Otherwise, you can
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
数字人分身源码,2024很火的项目 (2005个子文件)
app.df916d66.css 381KB
index.97465e7b.css 94KB
index.97465e7b.css 94KB
index.97465e7b.css 94KB
layui.css 73KB
skin.css 71KB
skin.css 71KB
skin.min.css 60KB
skin.min.css 60KB
font-awesome.css 37KB
editor_ie8.css 37KB
editor_iequirks.css 36KB
editor_ie.css 36KB
editor_gecko.css 35KB
editor.css 35KB
jquery-ui.min.css 31KB
jquery-ui.min.css 31KB
font-awesome.min.css 30KB
skin.mobile.css 24KB
skin.mobile.css 24KB
content.css 24KB
content.inline.css 24KB
content.inline.css 24KB
content.css 23KB
content.min.css 21KB
content.inline.min.css 21KB
content.inline.min.css 21KB
content.min.css 21KB
skin.mobile.min.css 21KB
skin.mobile.min.css 21KB
layuimini.css 20KB
formSelects-v4.css 18KB
chunk-vendors.25a017a6.css 16KB
dialog_ie8.css 15KB
dialog_iequirks.css 14KB
dialog_ie.css 14KB
layer.css 14KB
dialog.css 13KB
welcome.css 12KB
public.css 12KB
layui.mobile.css 10KB
laydate.css 7KB
login.css 6KB
5508.3dc82850.css 5KB
25.125e0808.css 5KB
666.e7694a45.css 5KB
3341.df0f1571.css 5KB
396.a579624a.css 5KB
8686.a579624a.css 5KB
9445.dbb0c26a.css 5KB
8995.23a5a4e4.css 5KB
9693.5511d6f5.css 5KB
9534.5511d6f5.css 5KB
2397.23a5a4e4.css 5KB
3625.dbb0c26a.css 5KB
6379.74d55a31.css 4KB
9745.50ea2727.css 4KB
5159.ffa19168.css 4KB
2273.36a328ef.css 4KB
419.36a328ef.css 4KB
2273.ffa19168.css 4KB
default.css 4KB
2128.453b944f.css 4KB
4889.e9e5763f.css 4KB
1190.6f182c2f.css 4KB
4889.6f182c2f.css 4KB
3799.453b944f.css 4KB
8190.e9e5763f.css 4KB
2205.f06bcce7.css 4KB
1309.3ade12b7.css 4KB
1143.69d89102.css 4KB
4047.52445cb3.css 4KB
434.e07aefb3.css 4KB
2894.e07aefb3.css 4KB
3687.2ce5bb62.css 4KB
2596.2ce5bb62.css 4KB
733.50034bc1.css 4KB
9702.50034bc1.css 4KB
8498.50034bc1.css 4KB
3297.da6d173c.css 4KB
5800.50034bc1.css 4KB
591.50034bc1.css 4KB
8414.da6d173c.css 4KB
646.da6d173c.css 4KB
4227.50034bc1.css 4KB
7420.50034bc1.css 4KB
2704.50034bc1.css 4KB
9964.da6d173c.css 4KB
6139.da6d173c.css 4KB
3258.da6d173c.css 4KB
7617.8bfe9e70.css 4KB
9797.fe6bae8e.css 4KB
3861.8bfe9e70.css 4KB
4520.fe6bae8e.css 4KB
7321.fe6bae8e.css 4KB
3269.8bfe9e70.css 4KB
1891.8bfe9e70.css 4KB
8001.fe6bae8e.css 4KB
1116.fe6bae8e.css 4KB
3711.fe6bae8e.css 4KB
共 2005 条
- 1
- 2
- 3
- 4
- 5
- 6
- 21
资源评论
2401_88771039
- 粉丝: 22
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 模拟题最终版.docx
- Java Web实验报告一:通讯录
- 不同温度下的光谱数据,仅截取550nm-700nm
- 不同温度下的光谱数据,仅截取550nm-700nm
- HengCe-18900-2024-2030全球与中国eMMC和UFS市场现状及未来发展趋势-样本.docx
- 2024第十四届APMCM亚太地区-C题完整论文.pdf
- HengCe-18900-2024-2030中国硬碳负极材料市场现状研究分析与发展前景预测报告-样本.docx
- PHP面向对象与设计模式
- HengCe-2024-2030全球与中国掩模基板市场现状及未来发展趋势-样本
- CSS3制作的聚光灯下倒影文字选装动画特效代码.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功