Download the PHP package mufuphlex/array-util without Composer

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

mufuphlex array-util

Latest Stable Version License

Array utils - smart&fast array helpers.

These helpers, among other things, provide a significantly improved (about 10-30 times faster) analogues of built-in PHP array functions, like unique() or intersect().

unique() function

This is an improved (30 times faster!) implementation of standard array_unique() PHP function.

intersect() function

This is an improved (10 times faster!) implementation of standard array_intersect() PHP function.

cutBy*() functions

If you need to remove particular elements from an array by elements' keys, cutByWhitelist(array $array, array $map) and cutByBlacklist(array $array, array $map) can be very useful. cutByWhitelist() leaves in $array only elements which are listed in the $map and cutByBlacklist() - just in opposite - removes from $array elements listed in $map. Moreover, these functions can not only remove, but also modify $array's members via callbacks - smth like an extended version of standard PHP function array_walk().

How to use it?

Let's consider the following sample array:

$array = [
    'result' => [
        'one' => [
            'param 1' => 1,
            'param 2' => 2,
            'param 3' => 3,
        ],
        'another' => [
            'param 1' => 4,
            'param 2' => 5,
            'param 3' => 6,
        ],
        'another one' => [
            'param 1' => 7,
            'param 2' => 8,
            'param 3' => 9,
        ]
    ],
    'errors' => [
        'form' => [
            'field 1' => [
                0 => 'error 1',
                1 => 'error 2'
            ],
            'field 2' => [
                0 => 'error 3',
                1 => 'error 4 '
            ]
        ],
        'logic' => [
            0 => 'logic error 1',
            1 => 'logic error 2'
        ]
    ],
    0 => [
        0 => 'item 1',
        1 => 'item 2'
    ],
    1 => [
        0 => 'item 3',
        1 => 'item 4'
    ],
    '123 - numeric containing' => [
        0 => 'item 5',
        1 => 'item 6'
    ],
    'not numeric containing' => [
        0 => 'item 5',
        1 => 'item 6'
    ],

];
  1. Leave/remove elements in/from `array.result*` with keys containing only `one` or only `another`:
    $map = [
        'result' => [
            '/^(?:one|another)$/' => true
        ]
    ];
    
  2. Leave/remove only elements in/from `array.errors.logic`:
    $map = [
        'errors' => [
            'logic' => true
        ]
    ];
    
  3. Leave/remove only elements with key `0` from `array.errors.form.field *.*`:
    $map = [
        'errors' => [
            'form' => [
                'field \d+' => [
                    0 => true
                ]
            ]
        ]
    ];
    
  4. Leave/remove elements in/from `array.result.*` with keys `param 3` and/or modify these elements' values by adding 5:
    $map = [
        'result' => [
            '/.+/' => [
                'param 3' => function($arg){ return $arg+=5; }
            ]
        ]
    ];
    

All versions of array-util with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
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 mufuphlex/array-util contains the following files

Loading the files please wait ....