ericpugh/handy

Handy PHP Utility library

1.0.0 2019-12-16 19:44 UTC

This package is auto-updated.

Last update: 2024-05-10 05:02:16 UTC


README

A handy (and dead simple) PHP utility library.

Installation

Install with composer:

composer require ericpugh/handy
  • requires with PHP 7.3 or greater.

Utility Classes

Methods

Arrays

Array utilities.

  • ::flatten() Flatten a multi-dimensional array into a single level
  • ::get() Get a specific array value by key.
  • ::isAssoc() Check if an array is associative.

DateTimes

Date and Time utilities.

  • ::convertDateFormat() Format a date string.

Markup

Utilities working with HTML markup.

  • ::clean() Trim HTML tags/attributes from a string.
  • ::getUrl() Get a URL from given HTML markup.

Files

File system utilities.

  • ::loadFile() Load a local JSON file.

Strings

String utilities.

  • ::truncateText()

Validators

Data validation utilities.

  • ::isNull()

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

License

The MIT License (MIT). Please see License File for more information.