Curried versions of common PHP functions.
composer require mckayb/phantasy-php
use function Phantasy\PHP\{explode, implode};
$explodeBySpace = explode(' ');
$arr = $explodeBySpace('foo bar');
// ['foo', 'bar']
$implodeWithCommas = implode('-');
$implodeWithCommas($arr);
// 'foo,bar'
For more information, read the docs!
I'm slowly working my way up to all of the PHP functions, but I should have most of the ones that people use in their everyday code covered. If I'm missing one that you need, let me know by opening up an issue or a pull request.
Find a bug? Want to make any additions? Just create an issue or open up a pull request.