Collection of useful PHP functions, mini-classes, and snippets for every day.
Collection of useful PHP functions, mini-classes, and snippets for every day.
Collection of PHP functions, mini classes and snippets for everyday developer's routine life.
composer require jbzoo/utilsuse function JBZoo\Utils\alias;
use function JBZoo\Utils\alpha;
use function JBZoo\Utils\alphanum;
use function JBZoo\Utils\bool;
use function JBZoo\Utils\digits;
use function JBZoo\Utils\float;
use function JBZoo\Utils\int;
int(' 10.0 ') === 10;
float(' 10.0 ') === 10.0;
bool(' yes ') === true;
bool(' no ') === false;
bool('1') === true;
bool('0') === false;
alias('Qwer ty') === 'qwer-ty';
digits('Qwer 1 ty2') === '12';
alpha('Qwer 1 ty2') === 'Qwerty';
alphanum(' #$% Qwer 1 ty2') === 'Qwer1ty2';……Csv::parse(string $csvFile, string $delimiter = ';', string $enclosure = '"', bool $hasHeader = true): array; // Simple parser for CSV files.
………………IP::getNetMask(string $ipAddress): ??string; // Return network mask. For example, '192.0.0.0' => '255.255.255.0'.
// Returns the IP address of the client.
// ONLY use if your server is behind a proxy that sets these values
IP::getRemote(bool $trustProxy = false): string;
IP::v4InRange(string $ipAddress, string $range): bool; // Check if a given ip is in a network.
…// Simple parse of PHPDocs.
// Example or return value
// [
// 'description' => 'Simple parse of PHPDocs. Example or return value',
// 'params' => [
// 'param' => ['string $phpDoc'],
// 'return' => ['array']
// ]
// ].
PhpDocs::parse(string $phpDoc): array;
…………Timer::format(float $milliSeconds): string; // Formats the elapsed time as a string.
Timer::formatMS(float $seconds): string; // Formats the elapsed time as a string.
Timer::getRequestTime(): float; // Get request time in microseconds.
Timer::timeSinceStart(): float; // Formats the elapsed time since the start of the request as a string.
………make
make test-allMIT
composer update.No open issues yet, or sync has not completed.