2.0.2 • Published 3 years ago

php-array-funcs v2.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

JS array functions with PHP syntax

Functions available in this release:

  • array_sum(arr) - returns the sum of array elements
  • array_reverse(arr) - reverses the submitted array's order of elements
  • array_merge(arr1, arr2, ...) - merges submitted arrays into one
  • array_chunk(arr, chunkSize) - split the specified array into sub-arrays

Usage examples

let php = require('php-array-funcs');

myArray = [1, 2, 3, 4, 5];

console.log(php.array_sum(myArray));

console.log(php.array_reverse(myArray));

console.log(php.array_merge(myArray, [7,8,9], [-4, -7, -99]));

console.log(php.array_chunk(myArray, 2));
2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago