Skip to content

Instantly share code, notes, and snippets.

Avatar
👻
looking for impossible task

rambkk

👻
looking for impossible task
View GitHub Profile
@rambkk
rambkk / PHP-array_reduce,findIndex,findIndexes.php
Created Oct 3, 2021
PHP array_reduce, findIndex, and findIndexes functions
View PHP-array_reduce,findIndex,findIndexes.php
<?php
/*
* PHP array_reduce_JS (v0.1) - array_reduce with additional parameters
* (javascript like reduce method)
*
* PHP findIndex (v0.1) - get index of first array item which passes callback
* (javascript like findIndex)
*
* PHP findIndexes (v0.1) - get index list of items which passes callback on array
*