blok/utils

A series of utilites functions for PHP

1.2.1 2022-06-20 15:19 UTC

This package is auto-updated.

Last update: 2024-12-20 20:49:38 UTC


README

Packagist Packagist Packagist

Utilities script for PHP projects

Installation

Install via composer

composer require blok/utils

Usage

Arr

Blok\Utils\Arr is a bunch of array related methods utilities that you can use as static call exemple :

Blok\Utils\Arr::csvToArray('xxx.csv')

Will transform a csv file to an array

Str

Blok\Utils\Str is a bunch of String related methods utilities that you can use as static call exemple :

Str::smrtr('{hello} world', ["hello", "Hello"])

Will replace the braced {hello} with the value of the array

Utils

Blok\Utils\Utils is a bunch of common PHP utils methods that you can use as static call exemple :

Utils::getJSON("xxx.json"")

Will make a file_get_contents + a json_decode

Utils::removeSubfolder($your_dir, ".git"")

Will remove all the .git folder.

Security

If you discover any security related issues, please email instead of using the issue tracker.

Credits