sikaradev-php-utils / helper
A php library for daily usage
v1.3.0
2023-09-10 18:58 UTC
Requires
- ext-json: *
- ext-redis: *
- guzzlehttp/guzzle: ^7.0
- league/pipeline: ^1.0
- symfony/css-selector: ^5.4
- symfony/dom-crawler: ^5.4
Requires (Dev)
- phpunit/phpunit: ^9.6
- symfony/var-dumper: ^5.4
README
A php helpers functions for usage in daily dev
filter
function
A function to filter a collection of any data type
Usage:
<?php $filteredItems = Collection::of(['index.php', 'data/country.json']) ->filter((int $k,string $v)=>$v==1)
map
function
Convert the data into other type of data
Usage:
<?php $result = Collection::of(['index.php', 'data/country.json']) ->filter(fn(int $k, string $path) => $k == 0) ->map(fn(string $v) => strtoupper($v)) ->get();