Skip to content

unreal4u/arrayOperations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

arrayOperations.class.php

Credits

This class is made by unreal4u (Camilo Sperberg). http://unreal4u.com/

About this class

  • Originally conceived to be a receiver of all loose array-related functions that I've made throughout the years
  • Later also a playground to learn about Iterators and SPL functions (related to arrays)

Detailed description

This package is a collection of functions related to array manipulation.

Basic usage

include('arrayOperations.class.php');
$arrayOperations = new arrayOperations();
$result = $arrayOperations->getNextAndPrevious(11, array(1, 3, 5, 6, 8, 11));
  • Congratulations! The returned array will look very similar to this:
 array (size=3)
  'prev' => int 8
  'next' => boolean false
  'curr' => int 11
 
  • Please see examples and PHPUnit tests for more options and advanced usage

Pending

  • Search for more loose functions spattered around my codebase

Version History

  • 0.1:
    • Created class

Contact the author

About

Playground to learn about Iterators and SPL functions related to arrays

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages