Download the PHP package sajadsdi/array-dot-notation without Composer

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

PHP Array Dot Notation

Array Dot Notation

Array Dot Notation is a high-performance and lightweight PHP library that allows you to set and get values in arrays using dot notation. It simplifies working with nested arrays by providing an intuitive way to access and modify data.

Features

Installation

You can install this library using Composer. If you haven't already set up Composer for your project, you can do so by following the official Composer installation guide.

Once Composer is installed, run the following command to install Array Dot Notation:

Usage

Basic Usage

Here's how you can use Array Dot Notation in your PHP project:

Advanced Usage

Example 1: Getting Multiple Values Simultaneously

You can retrieve multiple values simultaneously using dot notation:

Example 2: Mapping Keys for Output Data in Get

You can map keys for the output data when using the get method:

Example 3: Automatic Key Handling for Duplicate Keys

When you get values without using a map, the library will automatically handle duplicate keys:

Example 4: Automatic Key Handling for Numeric Keys

When the last key is a numeric index, it will use the input array index:

Example 5: Using get with a Single Default Value

In this example, we retrieve the value of the "user.profile.name" key from the data. This key doesn't exist, the default value "Guest" is returned.

Example 6: Using get with a Single Default Value and an Existing Key

In this example, we retrieve the value of the "user.profile.pic" key from the data. Since this key exists in the data, the actual value of the key is returned, and the default value is ignored.

Example 7: Using get with Multiple Default Values

In this example, we retrieve the values of the "user.profile.name" and "user.profile.bio" keys from the data. If either of these keys doesn't exist, the corresponding default values are returned for each key.

Example 8: Using multiple get with one Default Value

In this example, we retrieve the values of the "user.profile.name" and "user.profile.bio" keys from the data. If either of these keys doesn't exist, default value are returned for each key.

Example 9: Using multiple key in has method

In this example, we check for exist the "user.profile.name" and "user.profile.bio" keys in the data. if all keys exists in the data ,true returned.

Example 10: Using hasOne method

if one of all keys exist in the data ,true returned.

These examples demonstrate the advanced capabilities of the Array Dot Notation library for handling various scenarios when accessing and manipulating nested arrays using dot notation.

Contributing

We welcome contributions from the community to improve and extend this library. If you'd like to contribute, please follow these steps:

  1. Fork the repository on GitHub.
  2. Clone your fork locally.
  3. Create a new branch for your feature or bug fix.
  4. Make your changes and commit them with clear, concise commit messages.
  5. Push your changes to your fork on GitHub.
  6. Submit a pull request to the main repository.

Reporting Bugs and Security Issues

If you discover any security vulnerabilities or bugs in this project, please let us know through the following channels:

Contact

If you have any questions, suggestions, financial, or if you'd like to contribute to this project, please feel free to contact the maintainer:

We appreciate your feedback, support, and any financial contributions that help us maintain and improve this project.

License

This library is open-source software licensed under the MIT License.


All versions of array-dot-notation 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 sajadsdi/array-dot-notation contains the following files

Loading the files please wait ....