Source for file ArrayTools.php
Documentation is available at ArrayTools.php
- 1: <?php
- 3: /**
- 4: * Nette Framework
- 5: *
- 11: */
- 15: /**
- 16: * Array tools library.
- 17: *
- 20: */
- 22: {
- 24: /**
- 25: * Static class - cannot be instantiated.
- 26: */
- 28: {
- 30: }
- 34: /**
- 35: * Returns array item or $default if item is not set.
- 36: * Example: $val = ArrayTools::get($arr, 'i', 123);
- 41: */
- 43: {
- 49: }
- 50: }
- 52: }
- 56: /**
- 57: * Returns reference to array item or $default if item is not set.
- 61: */
- 63: {
- 69: }
- 70: }
- 72: }
- 76: /**
- 77: * Recursively appends elements of remaining keys from the second array to the first.
- 81: */
- 83: {
- 88: }
- 89: }
- 91: }
- 95: /**
- 96: * Searches the array for a given key and returns the offset if successful.
- 100: */
- 102: {
- 105: }
- 109: /**
- 110: * Inserts new array before item specified by key.
- 115: */
- 117: {
- 119: $arr = array_slice($arr, 0, $offset, TRUE) + $inserted + array_slice($arr, $offset, count($arr), TRUE);
- 124: /**
- 125: * Inserts new array after item specified by key.
- 130: */
- 132: {
- 135: $arr = array_slice($arr, 0, $offset, TRUE) + $inserted + array_slice($arr, $offset, count($arr), TRUE);
- 140: /**
- 141: * Renames key in array.
- 146: */
- 148: {
- 154: }
- 155: }
- 157: }