Download the PHP package marsapp/arrayhelper without Composer

On this page you can find all versions of the php package marsapp/arrayhelper. 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 arrayhelper

ArrayHelper

Array processing library, providing functions such as rebuilding indexes, grouping, getting content, recursive difference sets, recursive sorting, etc.

Continuation library marshung/helper, only keep and maintain ArrayHelper

Latest Stable Version Total Downloads Latest Unstable Version License

Outline

Installation

Composer Install

Include

Include composer autoloader before use.

Usage

Example

Namespace use:

API Reference

indexBy()

Data re-index by keys

Since $data is a reference, $data will change after indexBy() is executed.
Since $data is a reference, the return is useless.
If you want to keep $data, you can clone it before using it.

Example :

groupBy()

Data re-index and Group by keys

Since $data is a reference, $data will change after indexBy() is executed.
Since $data is a reference, the return is useless.
If you want to keep $data, you can clone it before using it.

Example :

$data reqult:

indexOnly()

Data re-index by keys, No Data

Since $data is a reference, $data will change after indexBy() is executed.
Since $data is a reference, the return is useless.
If you want to keep $data, you can clone it before using it.

Example :

$data reqult:

getContent()

Get Data content by index

Example:

getFallContent()

Get fall point content

  1. Get the data in an ordered non-contiguous index array
  2. If there is no fall point, return null.
  3. Ensure performance by sorting $data ahead of time:
    • a. Sorting $data (ASC)
    • b. Close $sortOut
    • c. Use function ArrayHelper::getFallContent()

Parameters

  • $data: The array to compare from. array
  • $referKey: Refer key to compare against. string
  • $sortOut: Whether the input needs to be rearranged. Value: true, false, 'default'. If it is 'default', see getSortOut()

Return Values

  • Returns the resulting mixed.

Example :

gather()

Data gather by list

Collect and classify target data according to the list of fields

Example Data :

Example 1 :

Field manager, s_manager, c_user values are placed in the same one-dimensional array

$ssnList1 reqult:

Example 2 :

The field manager is placed in an array, the fields s_manager, and the c_user values are placed in the same array. Form a 2-dimensional array

$ssnList2 reqult:

diffRecursive()

Array Deff Recursive

Compare $srcArray with $contrast and display it if something on $srcArray is not on $contrast.

Example :

$diff result :

sortRecursive()

Array Sort Recursive

$srcArray is a reference
$type : ksort(default), krsort, sort, rsort

Example :

$data1 result:

$data2 result:

filterKey()

Filter array according to the allowed keys

Parameters

  • $array: The array to compare from. array
  • $keys: Key list to compare against. array|string
  • $fillKey: Fill the key that does not exist in the array, default true. bool

Return Values

  • Returns the resulting array.

Example :


All versions of arrayhelper with dependencies

PHP Build Version
Package Version
Requires php Version ^7
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 marsapp/arrayhelper contains the following files

Loading the files please wait ....