Skip to content

MASNathan/chain-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chain-php

Chainable native functions and more

Usage

$domain = explode('@', 'andre.r.flip@gmail.com');
$domain = end($domain);
$domain = trim($domain);

$domain = with('andre.r.flip@gmail.com')->explode('@', '$$')->end()->trim()->get();
// 'gmail.com'

or

$key = with('some.service.3rdparty.integration')
    ->explode('.', '!!')
    ->array_map(function ($value) {
        return $value == '3rdparty' ? 'local' : $value;
    }, '!!')
    ->implode('.', '!!')
    ->get();
// 'some.service.local.integration'

Inspired by Sebastiaan Luca Pipe item

About

Chainable native functions and more

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages