2017 © Pedro Peláez
 

library helpers

some common and useful helpers

image

sidfate/helpers

some common and useful helpers

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Helpers Build Status

Some common and useful helpers in PHP, (*1)

Install

composer require sidfate/helpers
composer require sidfate/helpers:dev-master  

Usage

Arr

array functions., (*2)

use Helpers\Arr;

// Get the first value.
Arr::first(array $arr);

// Get the last value.
Arr::last(array $arr);

// Get the value if not exists return the default.
Arr::get(array $arr, $key, $default = null);

// Transform a array into object.
Arr::toObject(array $arr);

// Flatten a multi-dimensional array to a one-dimensional array.
Arr::flat(array $arr);

// Pluck the given key's value from a two-dimensional array.
Arr::pluck(array $arr, $key);

Str

string functions., (*3)

use Helpers\Str;

// Change the str to camel case.
Str::camel($str);

// * Get the limited str.
Str::limit($str, $length=50, $end="..."); 

Verify

verification functions., (*4)

use Helpers\Verify;

// Verify is a valid email address
Verify::isEmail($email)

// Verify is a valid ip address
Verify::isIp($ip)

// Verify is a valid url
Verify::isUrl($url)

Http

http functions., (*5)

use Helpers\Http;

// Get all HTTP headers
Http::getHeaders();

// Get the header value
Http::getHeader($key);

License

MIT, (*6)

The Versions

19/07 2017

dev-master

9999999-dev https://github.com/Sidfate/helpers

some common and useful helpers

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

helper

10/07 2017

1.0.0

1.0.0.0 https://github.com/Sidfate/helpers

some common and useful helpers

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

helper