PHP code example of dskripchenko / php-array-helper

1. Go to this page and download the library: Download dskripchenko/php-array-helper library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dskripchenko / php-array-helper example snippets


array_merge_deep(
    ['x' => ['a' => 1, 'b' => 2], 'y' => 1],
    ['x' => ['b' => 3, 'c' => 4], 'z' => 2],
);
// ['x' => ['a' => 1, 'b' => 3, 'c' => 4], 'y' => 1, 'z' => 2]

array_merge_deep([1, 2], [3, 4]); // [1, 2, 3, 4]

array_sort_deep(['b' => 2, 'a' => ['y' => 1, 'x' => 2]]);
// ['a' => ['x' => 2, 'y' => 1], 'b' => 2]

array_is_associative(['x' => 1]); // true
array_is_associative([1, 2, 3]);  // false

array_get_signature(['a' => 1, 'b' => 2]) === array_get_signature(['b' => 2, 'a' => 1]); // true
bash
composer