Download the PHP package me-io/php-lodash without Composer

On this page you can find all versions of the php package me-io/php-lodash. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-lodash

PHP Lodash

php-lodash is a PHP utility library, similar to Underscore/Lodash, that utilizes `namespace`s and dynamic auto loading to improve library performance.


Build Status Code Cov Scrutinizer downloads MIT License SymfonyInsight

PRs Welcome Code of Conduct Watch on GitHub Star on GitHub Tweet Donate

Table of Contents

Requirements

This library requires php php_mbstring extension. To enable this extension open your php.ini file and find for the line extension=php_mbstring.dll and uncomment it. If this line is not there then manually add this line in php.ini.

Introduction

lodash-php is a PHP utility library, similar to Underscore/Lodash, that utilizes namespaces and dynamic auto loading to improve library performance.

Project Structure


NOTE: lodash-php is not currently in feature parity with Underscore/Lodash. Review the contributing section for more information.


Installation

Just add me-io/php-lodash to your project composer.json file:

and then run composer install. This will install me-io/php-lodash and all it's dependencies. Or run the following command:

Usage

Arrays

__::append(array $array = [], $value = null)

Append item to array

__::compact(array $array = [])

Returns a copy of the array with falsy values removed.

__::flatten($array, $shallow = false)

Flattens a multidimensional array. If you pass shallow, the array will only be flattened a single level.

Patches array with list of xpath-value pairs.

__::prepend(array $array = [], $value = null)
__::range($start = null, $stop = null, $step = 1)

Returns an array of integers from start to stop (exclusive) by step.

Returns an array of $n length with each index containing the provided value.

__::chunk(array $array, $size = 1, $preserveKeys = false)

Split an array into chunks

__::drop(array $input, $number = 1)

Creates a slice of array with n elements dropped from the beginning.

__::randomize(array $array)

Shuffle an array ensuring no item remains in the same position.

__::search($array, $value)

Search for the index of a value in an array.

__::average($array, $decimals)

Returns the average value of an array.

__::size($array)

Get the size of an array.

__::contains($array, $value)

Check if an item is in an array.

__::clean(array $array)

Clean all falsy values from an array.

__::random(array $array, $take = null)

Get a random string from an array.

__::intersection(array $a, array $b)

Return an array with all elements found in both input arrays.

__::intersects(array $a, array $b)

Return a boolean flag which indicates whether the two input arrays have any common elements.

__::initial(array $array, int $to = 1)

Exclude the last X elements from an array

__::rest(array $array, int $from = 1)

Exclude the first X elements from an array

Sort an array by key.

____::without(array $array, $remove, $preserveKeys = false)

Remove unwanted values from array

Returns new array without preserving keys.

Returns new array with preserving keys.

Chaining

__::chain($initialValue)

Returns a wrapper instance, allows the value to be passed through multiple php-lodash functions

Collections

__::filter($array, callback($n))

Returns the values in the collection that pass the truth test.

__::first($array, [$n])

Gets the first element of an array. Passing n returns the first n elements.

__::get($array, JSON $string)

Get item of an array by index, aceepting nested index

__::last($array, [$n])

Gets the last element of an array. Passing n returns the last n elements.

__::map($array, callback($n))

Returns an array of values by mapping each in collection through the iterator.

__::max($array)

Returns the maximum value from the collection. If passed an iterator, max will return max value returned by the iterator.

__::min($array)

Returns the minimum value from the collection. If passed an iterator, min will return min value returned by the iterator.

__::pluck($array, $property)

Returns an array of values belonging to a given property of each item in a collection.

__::where($array, $parameters[])

Returns a collection of objects matching the given array of parameters.

__::assign($collection1, $collection2)

Combines and merge collections provided with each others.

__::reduceRight($collection, \Closure $iteratee, $accumulator = null)

Reduces $collection to a value which is the $accumulator result of running each element in $collection - from right to left - thru $iteratee, where each successive invocation is supplied the return value of the previous.

__::doForEachRight($collection, \Closure $iteratee)

Iterate over elements of the collection, from right to left, and invokes iterate for each element.

__::doForEach($collection, \Closure $iteratee)

Iterate over elements of the collection and invokes iterate for each element.

__::set($collection, $path, $value = null)

Return a new collection with the item set at index to given value. Index can be a path of nested indexes.

__::hasKeys($collection, $path, $value = null)

Returns if $input contains all requested $keys. If $strict is true it also checks if $input exclusively contains the given $keys.

__::has($collection, $path)

Return true if $collection contains the requested $key.

__::concat($collection1, $collection2)

Combines and concat collections provided with each others.

__::concatDeep($collection1, $collection2)

Recursively combines and concat collections provided with each others.

Flattens a complex collection by mapping each ending leafs value to a key consisting of all previous indexes.

__::every($collection, \Closure $iteratee)

Checks if predicate returns truthy for all elements of collection.

__::groupBy(array $array, $key)

Returns an associative array where the keys are values of $key.

__::isEmpty($value)

Check if value is an empty array or object.

__::merge($collection1, $collection2)

Recursively combines and merge collections provided with each others.

__::pick($collection = [], array $paths = [], $default = null)

Returns an array having only keys present in the given path list.

__::reduce($collection, \Closure $iteratee, $accumulator = null)

Reduces $collection to a value which is the $accumulator result of running each element in $collection thru $iteratee, where each successive invocation is supplied the return value of the previous.

Builds a multidimensional collection out of a hash map using the key as indicator where to put the value.

Strings

__::split($input, $delimiter, $limit = PHP_INT_MAX)

Split a string by string.

__::camelCase($input)

Converts string to camel case.

__::capitalize($input)

Converts the first character of string to upper case and the remaining to lower case.

__::kebabCase($input)

Converts string to kebab case.

__::lowerFirst($input)

Converts the first character of string to lower case, like lcfirst.

__::snakeCase($input)

Converts string to snake case.

__::startCase($input)

Converts string to start case.

__::toLower($input)

Converts string, as a whole, to lower case just like strtolower.

__::toUpper($input)

Converts string, as a whole, to lower case just like strtoupper.

__::upperCase($input)

Converts string, as space separated words, to upper case.

__::upperFirst($input)

Converts the first character of string to upper case, like ucfirst.

__::words($input, $pattern = null)

Splits string into an array of its words.

__::lowerCase($input)

Converts string, as space separated words, to lower case.

Functions

__::slug($string, [array $options])
__::truncate($string, [$limit=40])

Truncate string based on count of words

__::urlify($string)

Find the urls inside a string a put them inside anchor tags

Objects

__::isArray($array)

Check if give value is array or not.

__::isFunction($string)

Check if give value is function or not.

__::isNull($null)

Check if give value is null or not.

__::isNumber($int|$float)

Check if give value is number or not.

__::isObject($object)

Check if give value is object or not.

__::isString($string)

Check if give value is string or not.

Utilities

__::isEmail($string)

Check if the value is valid email.

__::now()

Wrapper of the time() function that returns the current offset in seconds since the Unix Epoch.

__::stringContains($needle, $haystack, [$offset])

Wrapper of the time() function that returns the current offset in seconds since the Unix Epoch.

Change log

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

Testing

Contributing

Please feel free to contribute to this project! Pull requests and feature requests welcome! :v:

Please see CODE_OF_CONDUCT for details.

Contributors

A huge thanks to all of our contributors:


Mohamed Meabed

💻 ⚠️ 📢

Zeeshan Ahmad

💻 🐛 ⚠️ 📖

License

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


All versions of php-lodash with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package me-io/php-lodash contains the following files

Loading the files please wait ....