alecrabbit/php-helpers

PHP helpers functions

Fund package maintenance!
Patreon

0.8.2 2020-05-17 18:32 UTC

README

Set of useful helper functions

PHP Version Build Status Appveyor Status Scrutinizer Code Quality Code Coverage Total Downloads

Latest Stable Version Latest Stable Version Latest Unstable Version

License

Installation

composer require alecrabbit/php-helpers

Usage

See examples

Quick example
use function \AlecRabbit\typeOf;

echo typeOf(1); // "integer"

Functions

Miscellaneous Functions

  • typeOf()
  • swap()
  • inContainer()
  • inRange()
  • onWindows()

Array functions

  • is_homogeneous()
  • formatted_array()
  • array_unset_first()
  • array_unset_last()

Numeric functions

  • is_negative()
  • bounds()
  • trim_zeros()

Object functions

  • callMethod()
  • getValue()

Time functions

  • now()
  • carbon()
  • base_timestamp()

String functions

  • tag()
  • brackets()
  • str_wrap()
  • format_bytes()
  • format_time()
  • format_time_auto()
  • boolToStr()