A php library for daily usage

v1.3.0 2023-09-10 18:58 UTC

This package is auto-updated.

Last update: 2024-04-10 21:55:22 UTC


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();