Stringer
, (*1)
Introduction
Stringer is stand alone PHP package for string manipulation with an expresive syntax., (*2)
Instalation
This package required composer, (*3)
``` sh
composer require muhamadrezaar/stringer, (*4)
then in your file php
include "vendor/autoload.php";, (*5)
### 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, (*6)
``` sh
custom(function($string){
// your own manipulation syntax
})
->display()
?>, (*7)
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/, (*8)
Development will continue fork this repo and pull request, (*9)