Skip to content

rambkk/PHP-utility

Repository files navigation

PHP-utility

PHP utility - functions to simplify basic tasks --- Additional functions for working on array

(c) Ram Narula You can use this information, kindly do give credit: github rambkk - Ram Narula - pluslab.net
Please drop a line to say hello and let me know what kind of project you are working on :-)
rambkk - pluslab.net - looking for impossible projects

PHP array_reduce_JS – array_reduce with additional parameters
(javascript like reduce method) (array_reduce with key / index)
(if initial value of carry item is not specified,
initial carry item is the first item of array
and the callback starts on the second item)

PHP array_reduce_key – array_reduce with additional parameters
(javascript like reduce method) (array_reduce with key / index)
(if initial value of carry item is not specified,
initial value of carry is null)

PHP findIndex – get index of first array item which passes callback
(javascript like findIndex) (PHP findIndex)

PHP findIndexes – get index list of items which passes callback on array
(PHP findIndexes, list of all matches)

Usage: Include the file into the PHP code.

Check example.php file for sample function calls.

<?php

require_once('array_reduce_JS.php');
require_once('array_reduce_key.php');
require_once('findIndex.php');
require_once('findIndexes.php');

?>

(c) Ram Narula You can use this information, kindly do give credit: github rambkk - Ram Narula - pluslab.net

About

PHP utility - functions to simplify basic tasks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages