Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/julles/stringer
Manipulation PHP String Package
https://github.com/julles/stringer
php php5 php7 string string-manipulation stringer
Last synced: 1 day ago
JSON representation
Manipulation PHP String Package
- Host: GitHub
- URL: https://github.com/julles/stringer
- Owner: julles
- Created: 2018-07-20T21:22:28.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-07-22T18:33:51.000Z (over 6 years ago)
- Last Synced: 2024-10-13T13:03:50.522Z (about 1 month 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
[![Total Downloads](https://poser.pugx.org/muhamadrezaar/stringer/d/total.svg)](https://poser.pugx.org/muhamadrezaar/stringer/d/total.svg)
[![License](https://poser.pugx.org/muhamadrezaar/stringer/license.svg)](https://poser.pugx.org/muhamadrezaar/stringer/license.svg)
[![License](https://img.shields.io/github/release/julles/stringer.svg?style=flat-square)](https://github.com/julles/stringer/releases)
[![StyleCi](https://github.styleci.io/repos/141759070/shield)](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