alecrabbit/php-helpers

PHP helpers functions

0.6.3 2019-06-17 10:34 UTC

README

Set of useful helper functions

PHP Version Build 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()

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