PHP code example of mufuphlex / array-util

1. Go to this page and download the library: Download mufuphlex/array-util 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/ */

    

mufuphlex / array-util example snippets


$arr = [1,2,3,1,2,3];
$unique = \Mufuphlex\Util\ArrayUtil::unique($arr);
// [1,2,3]

$a = [1,2,3];
$b = [2,3,4];
$c = [3,4,5];
$result = \Mufuphlex\Util\ArrayUtil::intersect($a, $b, $c);
// [3]