Download the PHP package luminovang/array-functions without Composer

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

Luminova Array Procedural Functions

A lightweight utility package for array operations offering procedural functions like array_find, array_all, and more. These functions are already supported in PHP 8.1 and later. This package provide backward compatibility for PHP 8.0.


Install via Composer

Recommend installation method:

Include File

You can also use the function in another projects.


Importing the Functions

You can import multiple functions at once using the use function syntax with braces around the function names:

Importing a Specific Function:

To import a specific function, such as array_find, use the following syntax:


Example Usage

Finding an Element in an Array

The array_find function allows you to find the first element in an array that satisfies a given condition specified in a callback.

In this example, array_find returns the first element greater than 3, which is 4.


Finding the Key of an Element in an Array

The array_find_key function searches for the first key where the corresponding value meets the given condition.

Here, array_find_key finds the key of 'banana', which is 1.

Another Example

Find key using str_starts_with.

In this case, array_find_key returns the key 'php', where the key starts with 'p'.


Checking If All Elements Meet a Condition

The array_all function checks if all elements in the array satisfy the condition defined in the callback.

In this example, array_all returns true because all elements in the array are even numbers.


Checking If Any Element Meets a Condition

The array_any function checks if at least one element in the array meets the condition specified in the callback.

In this case, array_any returns true because one element (3) is greater than 2.


All versions of array-functions 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 luminovang/array-functions contains the following files

Loading the files please wait ....