Some wrappers for php array functions, which provides callback-ability to them
It is not another implementation of core same-named functions. Packet internally uses php core same-named functions (all magic from Decorators), so you can be sure, that callbackable function will work totally like same core function of your php version
- array_unique
Use composer:
composer require jizuscreed/callbackable-array-functions
<?php
use jizuscreed\CallbackableArrayFunctions\ArrayUnique;
// array of objects or another multidimensional arrays
$array = [...];
$array = ArrayUnique::run($array, function($arrayValue){
// some logic, that returns string representation of one array value. Be carefull with it because array elements will be checked for differences by result of this callback
return $arrayValue->title;
});
MIT, so feel free to do whatever you want with this code