https://github.com/julles/stringer
Manipulation PHP String Package
https://github.com/julles/stringer
php php5 php7 string string-manipulation stringer
Last synced: 4 months ago
JSON representation
Manipulation PHP String Package
- Host: GitHub
- URL: https://github.com/julles/stringer
- Owner: julles
- Created: 2018-07-20T21:22:28.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-07-22T18:33:51.000Z (almost 7 years ago)
- Last Synced: 2025-01-19T21:48:40.067Z (6 months ago)
- Topics: php, php5, php7, string, string-manipulation, stringer
- Language: PHP
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Stringer
[](https://poser.pugx.org/muhamadrezaar/stringer/d/total.svg)
[](https://poser.pugx.org/muhamadrezaar/stringer/license.svg)
[](https://github.com/julles/stringer/releases)
[](https://github.styleci.io/repos/141759070/shield)### Introduction
Stringer is stand alone PHP package for string manipulation with an expresive syntax.
### Instalation
This package required composer
``` sh
composer require muhamadrezaar/stringer
```then in your file php
```
include "vendor/autoload.php";
```### Example
Here is the basic usage and some examples methods:
``` sh
reverse()->display(); // return "emosewa si php"$str->substring(0,1)->display(); // return "r"
?>
```
Custom Method
``` sh
custom(function($string){
// your own manipulation syntax
})
->display()
?>```
Using chaining method
``` sh
$str = stringer('azer')
->reverse()
->replace("a","i")
->repeat(2," ")
->display(); // return "rezi rezi"```
### Available Methods
| Methods |
| ------- |
| ->reverse() |
| ->substring($start = 0, $end = 0) |
| ->custom(callable $string) |
| ->camelCase($separator = " ") |
| ->appendFirst($first="") |
| ->appendLast($last="") |
| ->repeat($loop=1,$separator="") |
| ->upperFirst() |
| ->lowerFirst() |
| ->upperLast() |
| ->lowerLast() |
| ->replace($search,$replace) |
| ->shuffle() |
| ->reverse() |### License
https://reza.mit-license.org/
Development will continue fork this repo and pull request