‪TYPO3CMS  10.4
ArrayUtility.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
19 
24 {
33  public static function ‪assertAllArrayKeysAreValid(array $arrayToTest, array $allowedArrayKeys)
34  {
35  $notAllowedArrayKeys = array_keys(array_diff_key($arrayToTest, array_flip($allowedArrayKeys)));
36  if (count($notAllowedArrayKeys) !== 0) {
37  throw new \InvalidArgumentException(
38  sprintf(
39  'The options "%s" were not allowed (allowed were: "%s")',
40  implode(', ', $notAllowedArrayKeys),
41  implode(', ', $allowedArrayKeys)
42  ),
43  1325697085
44  );
45  }
46  }
47 
54  public static function ‪convertBooleanStringsToBooleanRecursive(array $array): array
55  {
56  $result = $array;
57  foreach ($result as $key => $value) {
58  if (is_array($value)) {
60  } else {
61  if ($value === 'true') {
62  $result[$key] = true;
63  } elseif ($value === 'false') {
64  $result[$key] = false;
65  }
66  }
67  }
68  return $result;
69  }
70 
104  public static function ‪filterByValueRecursive($needle = '', array $haystack = [])
105  {
106  $resultArray = [];
107  // Define a lambda function to be applied to all members of this array dimension
108  // Call recursive if current value is of type array
109  // Write to $resultArray (by reference!) if types and value match
110  $callback = function (&$value, $key) use ($needle, &$resultArray) {
111  if ($value === $needle) {
112  $resultArray[$key] = $value;
113  } elseif (is_array($value)) {
114  $subArrayMatches = static::filterByValueRecursive($needle, $value);
115  if (!empty($subArrayMatches)) {
116  $resultArray[$key] = $subArrayMatches;
117  }
118  }
119  };
120  // array_walk() is not affected by the internal pointers, no need to reset
121  array_walk($haystack, $callback);
122  // Pointers to result array are reset internally
123  return $resultArray;
124  }
125 
144  public static function ‪isValidPath(array $array, $path, $delimiter = '/')
145  {
146  $isValid = true;
147  try {
148  static::getValueByPath($array, $path, $delimiter);
149  } catch (‪MissingArrayPathException $e) {
150  $isValid = false;
151  }
152  return $isValid;
153  }
154 
180  public static function ‪getValueByPath(array $array, $path, $delimiter = '/')
181  {
182  // Extract parts of the path
183  if (is_string($path)) {
184  if ($path === '') {
185  // Programming error has to be sanitized before calling the method -> global exception
186  throw new \RuntimeException('Path must not be empty', 1341397767);
187  }
188  $path = str_getcsv($path, $delimiter);
189  } elseif (!is_array($path)) {
190  // Programming error has to be sanitized before calling the method -> global exception
191  throw new \InvalidArgumentException('getValueByPath() expects $path to be string or array, "' . gettype($path) . '" given.', 1476557628);
192  }
193  // Loop through each part and extract its value
194  $value = $array;
195  foreach ($path as $segment) {
196  if (is_array($value) && array_key_exists($segment, $value)) {
197  // Replace current value with child
198  $value = $value[$segment];
199  } else {
200  // Throw specific exception if there is no such path
201  throw new ‪MissingArrayPathException('Segment ' . $segment . ' of path ' . implode($delimiter, $path) . ' does not exist in array', 1341397869);
202  }
203  }
204  return $value;
205  }
206 
214  public static function ‪reIndexNumericArrayKeysRecursive(array $array): array
215  {
216  if (count(array_filter(array_keys($array), 'is_string')) === 0) {
217  $array = array_values($array);
218  }
219  foreach ($array as $key => $value) {
220  if (is_array($value) && !empty($value)) {
221  $array[$key] = ‪self::reIndexNumericArrayKeysRecursive($value);
222  }
223  }
224  return $array;
225  }
226 
233  public static function ‪removeNullValuesRecursive(array $array): array
234  {
235  $result = $array;
236  foreach ($result as $key => $value) {
237  if (is_array($value)) {
238  $result[$key] = ‪self::removeNullValuesRecursive($value);
239  } elseif ($value === null) {
240  unset($result[$key]);
241  }
242  }
243  return $result;
244  }
245 
272  public static function ‪setValueByPath(array $array, $path, $value, $delimiter = '/')
273  {
274  if (is_string($path)) {
275  if ($path === '') {
276  throw new \RuntimeException('Path must not be empty', 1341406194);
277  }
278  // Extract parts of the path
279  $path = str_getcsv($path, $delimiter);
280  } elseif (!is_array($path) && !$path instanceof \ArrayAccess) {
281  throw new \InvalidArgumentException('setValueByPath() expects $path to be string, array or an object implementing \\ArrayAccess, "' . (is_object($path) ? get_class($path) : gettype($path)) . '" given.', 1478781081);
282  }
283  // Point to the root of the array
284  $pointer = &$array;
285  // Find path in given array
286  foreach ($path as $segment) {
287  // Fail if the part is empty
288  if ($segment === '') {
289  throw new \RuntimeException('Invalid path segment specified', 1341406846);
290  }
291  // Create cell if it doesn't exist
292  if (is_array($pointer) && !array_key_exists($segment, $pointer)) {
293  $pointer[$segment] = [];
294  }
295  // Make it array if it was something else before
296  if (!is_array($pointer)) {
297  $pointer = [];
298  }
299  // Set pointer to new cell
300  $pointer = &$pointer[$segment];
301  }
302  // Set value of target cell
303  $pointer = $value;
304  return $array;
305  }
306 
316  public static function ‪removeByPath(array $array, $path, $delimiter = '/')
317  {
318  if (!is_string($path)) {
319  throw new \RuntimeException('Path must be a string', 1371757719);
320  }
321  if ($path === '') {
322  throw new \RuntimeException('Path must not be empty', 1371757718);
323  }
324  // Extract parts of the path
325  $path = str_getcsv($path, $delimiter);
326  $pathDepth = count($path);
327  $currentDepth = 0;
328  $pointer = &$array;
329  // Find path in given array
330  foreach ($path as $segment) {
331  $currentDepth++;
332  // Fail if the part is empty
333  if ($segment === '') {
334  throw new \RuntimeException('Invalid path segment specified', 1371757720);
335  }
336  if (!array_key_exists($segment, $pointer)) {
337  throw new ‪MissingArrayPathException('Segment ' . $segment . ' of path ' . implode($delimiter, $path) . ' does not exist in array', 1371758436);
338  }
339  if ($currentDepth === $pathDepth) {
340  unset($pointer[$segment]);
341  } else {
342  $pointer = &$pointer[$segment];
343  }
344  }
345  return $array;
346  }
347 
354  public static function ‪sortByKeyRecursive(array $array)
355  {
356  ksort($array);
357  foreach ($array as $key => $value) {
358  if (is_array($value) && !empty($value)) {
359  $array[$key] = ‪self::sortByKeyRecursive($value);
360  }
361  }
362  return $array;
363  }
364 
374  public static function ‪sortArraysByKey(array $arrays, $key, $ascending = true)
375  {
376  if (empty($arrays)) {
377  return $arrays;
378  }
379  $sortResult = uasort($arrays, function (array $a, array $b) use ($key, $ascending) {
380  if (!isset($a[$key]) || !isset($b[$key])) {
381  throw new \RuntimeException('The specified sorting key "' . $key . '" is not available in the given array.', 1373727309);
382  }
383  return $ascending ? strcasecmp($a[$key], $b[$key]) : strcasecmp($b[$key], $a[$key]);
384  });
385  if (!$sortResult) {
386  throw new \RuntimeException('The function uasort() failed for unknown reasons.', 1373727329);
387  }
388  return $arrays;
389  }
390 
402  public static function ‪arrayExport(array $array = [], $level = 0)
403  {
404  $lines = "[\n";
405  $level++;
406  $writeKeyIndex = false;
407  $expectedKeyIndex = 0;
408  foreach ($array as $key => $value) {
409  if ($key === $expectedKeyIndex) {
410  $expectedKeyIndex++;
411  } else {
412  // Found a non integer or non consecutive key, so we can break here
413  $writeKeyIndex = true;
414  break;
415  }
416  }
417  foreach ($array as $key => $value) {
418  // Indention
419  $lines .= str_repeat(' ', $level);
420  if ($writeKeyIndex) {
421  // Numeric / string keys
422  $lines .= is_int($key) ? $key . ' => ' : '\'' . $key . '\' => ';
423  }
424  if (is_array($value)) {
425  if (!empty($value)) {
426  $lines .= self::arrayExport($value, $level);
427  } else {
428  $lines .= "[],\n";
429  }
430  } elseif (is_int($value) || is_float($value)) {
431  $lines .= $value . ",\n";
432  } elseif ($value === null) {
433  $lines .= "null,\n";
434  } elseif (is_bool($value)) {
435  $lines .= $value ? 'true' : 'false';
436  $lines .= ",\n";
437  } elseif (is_string($value)) {
438  // Quote \ to \\
439  // Quote ' to \'
440  $stringContent = str_replace(['\\', '\''], ['\\\\', '\\\''], $value);
441  $lines .= '\'' . $stringContent . "',\n";
442  } else {
443  throw new \RuntimeException('Objects are not supported', 1342294987);
444  }
445  }
446  $lines .= str_repeat(' ', $level - 1) . ']' . ($level - 1 == 0 ? '' : ",\n");
447  return $lines;
448  }
449 
486  public static function ‪flatten(array $array, $prefix = '', bool $keepDots = false)
487  {
488  $flatArray = [];
489  foreach ($array as $key => $value) {
490  if ($keepDots === false) {
491  // Ensure there is no trailing dot:
492  $key = rtrim($key, '.');
493  }
494  if (!is_array($value)) {
495  $flatArray[$prefix . $key] = $value;
496  } else {
497  $newPrefix = $prefix . $key;
498  if ($keepDots === false) {
499  $newPrefix = $prefix . $key . '.';
500  }
501  $flatArray = array_merge($flatArray, self::flatten($value, $newPrefix, $keepDots));
502  }
503  }
504  return $flatArray;
505  }
506 
515  public static function ‪flattenPlain(array $array): array
516  {
517  $flattenRecursive = static function (array $array, string $prefix = '') use (&$flattenRecursive) {
518  $flatArray[] = [];
519  foreach ($array as $key => $value) {
520  $key = addcslashes((string)$key, '.');
521  if (!is_array($value)) {
522  $flatArray[] = [$prefix . $key => $value];
523  } else {
524  $flatArray[] = $flattenRecursive($value, $prefix . $key . '.');
525  }
526  }
527 
528  return array_merge(...$flatArray);
529  };
530 
531  return $flattenRecursive($array);
532  }
533 
569  public static function ‪intersectRecursive(array $source, array $mask = [])
570  {
571  $intersection = [];
572  foreach ($source as $key => $_) {
573  if (!array_key_exists($key, $mask)) {
574  continue;
575  }
576  if (is_array($source[$key]) && is_array($mask[$key])) {
577  $value = ‪self::intersectRecursive($source[$key], $mask[$key]);
578  if (!empty($value)) {
579  $intersection[$key] = $value;
580  }
581  } else {
582  $intersection[$key] = $source[$key];
583  }
584  }
585  return $intersection;
586  }
587 
613  public static function ‪renumberKeysToAvoidLeapsIfKeysAreAllNumeric(array $array = [], $level = 0)
614  {
615  $level++;
616  $allKeysAreNumeric = true;
617  foreach ($array as $key => $_) {
618  if (is_int($key) === false) {
619  $allKeysAreNumeric = false;
620  break;
621  }
622  }
623  $renumberedArray = $array;
624  if ($allKeysAreNumeric === true) {
625  $renumberedArray = array_values($array);
626  }
627  foreach ($renumberedArray as $key => $value) {
628  if (is_array($value)) {
629  $renumberedArray[$key] = ‪self::renumberKeysToAvoidLeapsIfKeysAreAllNumeric($value, $level);
630  }
631  }
632  return $renumberedArray;
633  }
634 
654  public static function ‪mergeRecursiveWithOverrule(array &$original, array $overrule, $addKeys = true, $includeEmptyValues = true, $enableUnsetFeature = true)
655  {
656  foreach ($overrule as $key => $_) {
657  if ($enableUnsetFeature && $overrule[$key] === '__UNSET') {
658  unset($original[$key]);
659  continue;
660  }
661  if (isset($original[$key]) && is_array($original[$key])) {
662  if (is_array($overrule[$key])) {
663  ‪self::mergeRecursiveWithOverrule($original[$key], $overrule[$key], $addKeys, $includeEmptyValues, $enableUnsetFeature);
664  }
665  } elseif (
666  ($addKeys || isset($original[$key])) &&
667  ($includeEmptyValues || $overrule[$key])
668  ) {
669  $original[$key] = $overrule[$key];
670  }
671  }
672  // This line is kept for backward compatibility reasons.
673  reset($original);
674  }
675 
683  public static function ‪removeArrayEntryByValue(array $array, $cmpValue)
684  {
685  foreach ($array as $k => $v) {
686  if (is_array($v)) {
687  $array[$k] = ‪self::removeArrayEntryByValue($v, $cmpValue);
688  } elseif ((string)$v === (string)$cmpValue) {
689  unset($array[$k]);
690  }
691  }
692  return $array;
693  }
694 
718  public static function ‪keepItemsInArray(array $array, $keepItems, $getValueFunc = null)
719  {
720  if ($array) {
721  // Convert strings to arrays:
722  if (is_string($keepItems)) {
723  $keepItems = ‪GeneralUtility::trimExplode(',', $keepItems);
724  }
725  // Check if valueFunc can be executed:
726  if (!is_callable($getValueFunc)) {
727  $getValueFunc = null;
728  }
729  // Do the filtering:
730  if (is_array($keepItems) && !empty($keepItems)) {
731  $keepItems = array_flip($keepItems);
732  foreach ($array as $key => $value) {
733  // Get the value to compare by using the callback function:
734  $keepValue = isset($getValueFunc) ? call_user_func($getValueFunc, $value) : $value;
735  if (!isset($keepItems[$keepValue])) {
736  unset($array[$key]);
737  }
738  }
739  }
740  }
741  return $array;
742  }
743 
750  public static function ‪remapArrayKeys(array &$array, array $mappingTable)
751  {
752  foreach ($mappingTable as $old => $new) {
753  if ($new && isset($array[$old])) {
754  $array[$new] = $array[$old];
755  unset($array[$old]);
756  }
757  }
758  }
759 
768  public static function ‪arrayDiffKeyRecursive(array $array1, array $array2): array
769  {
770  $differenceArray = [];
771  foreach ($array1 as $key => $value) {
772  if (!array_key_exists($key, $array2)) {
773  $differenceArray[$key] = $value;
774  } elseif (is_array($value)) {
775  if (is_array($array2[$key])) {
776  $recursiveResult = ‪self::arrayDiffKeyRecursive($value, $array2[$key]);
777  if (!empty($recursiveResult)) {
778  $differenceArray[$key] = $recursiveResult;
779  }
780  }
781  }
782  }
783  return $differenceArray;
784  }
785 
795  public static function ‪arrayDiffAssocRecursive(array $array1, array $array2, bool $useArrayDiffAssocBehavior = false): array
796  {
797  if (!$useArrayDiffAssocBehavior) {
798  return ‪self::arrayDiffKeyRecursive($array1, $array2);
799  }
800 
801  $differenceArray = [];
802  foreach ($array1 as $key => $value) {
803  if (!array_key_exists($key, $array2) || (!is_array($value) && $value !== $array2[$key])) {
804  $differenceArray[$key] = $value;
805  } elseif (is_array($value)) {
806  if (is_array($array2[$key])) {
807  $recursiveResult = ‪self::arrayDiffAssocRecursive($value, $array2[$key], $useArrayDiffAssocBehavior);
808  if (!empty($recursiveResult)) {
809  $differenceArray[$key] = $recursiveResult;
810  }
811  }
812  }
813  }
814  return $differenceArray;
815  }
816 
823  public static function ‪naturalKeySortRecursive(array &$array)
824  {
825  uksort($array, 'strnatcasecmp');
826  foreach ($array as $key => &$value) {
827  if (is_array($value)) {
829  }
830  }
831 
832  return true;
833  }
834 
844  public static function ‪filterAndSortByNumericKeys($setupArr, $acceptAnyKeys = false)
845  {
846  $filteredKeys = [];
847  $keys = array_keys($setupArr);
848  foreach ($keys as $key) {
849  if ($acceptAnyKeys || ‪MathUtility::canBeInterpretedAsInteger($key)) {
850  $filteredKeys[] = (int)$key;
851  }
852  }
853  $filteredKeys = array_unique($filteredKeys);
854  sort($filteredKeys);
855  return $filteredKeys;
856  }
857 
865  public static function ‪sortArrayWithIntegerKeys(array $array)
866  {
867  if (count(array_filter(array_keys($array), 'is_string')) === 0) {
868  ksort($array);
869  }
870  return $array;
871  }
872 
880  public static function ‪sortArrayWithIntegerKeysRecursive(array $array): array
881  {
882  $array = static::sortArrayWithIntegerKeys($array);
883  foreach ($array as $key => $value) {
884  if (is_array($value) && !empty($value)) {
885  $array[$key] = ‪self::sortArrayWithIntegerKeysRecursive($value);
886  }
887  }
888  return $array;
889  }
890 
897  public static function ‪stripTagsFromValuesRecursive(array $array): array
898  {
899  $result = $array;
900  foreach ($result as $key => $value) {
901  if (is_array($value)) {
902  $result[$key] = ‪self::stripTagsFromValuesRecursive($value);
903  } elseif (is_string($value) || (is_object($value) && method_exists($value, '__toString'))) {
904  $result[$key] = strip_tags((string)$value);
905  }
906  }
907  return $result;
908  }
909 
918  public static function ‪filterRecursive(array $array, callable $callback = null): array
919  {
920  $callback = $callback ?: function ($value) {
921  return (bool)$value;
922  };
923 
924  foreach ($array as $key => $value) {
925  if (is_array($value)) {
926  $array[$key] = ‪self::filterRecursive($value, $callback);
927  }
928 
929  if (!call_user_func($callback, $value)) {
930  unset($array[$key]);
931  }
932  }
933 
934  return $array;
935  }
936 
945  public static function ‪isAssociative(array $array): bool
946  {
947  return count(array_filter(array_keys($array), 'is_string')) > 0;
948  }
949 
959  public static function ‪replaceAndAppendScalarValuesRecursive(array $array1, array $array2): array
960  {
961  // Simple lists get merged / added up
962  if (!self::isAssociative($array1)) {
963  return array_merge($array1, $array2);
964  }
965  foreach ($array1 as $k => $v) {
966  // The key also exists in second array, if it is a simple value
967  // then $array2 will override the value, where an array is calling
968  // replaceAndAppendScalarValuesRecursive() recursively.
969  if (isset($array2[$k])) {
970  if (is_array($v) && is_array($array2[$k])) {
971  $array1[$k] = ‪self::replaceAndAppendScalarValuesRecursive($v, $array2[$k]);
972  } else {
973  $array1[$k] = $array2[$k];
974  }
975  unset($array2[$k]);
976  }
977  }
978  // If there are properties in the second array left, they are added up
979  if (!empty($array2)) {
980  foreach ($array2 as $k => $v) {
981  $array1[$k] = $v;
982  }
983  }
984 
985  return $array1;
986  }
987 }
‪TYPO3\CMS\Core\Utility\ArrayUtility\flatten
‪static array flatten(array $array, $prefix='', bool $keepDots=false)
Definition: ArrayUtility.php:486
‪TYPO3\CMS\Core\Utility\ArrayUtility\isAssociative
‪static bool isAssociative(array $array)
Definition: ArrayUtility.php:945
‪TYPO3\CMS\Core\Utility\ArrayUtility\keepItemsInArray
‪static array keepItemsInArray(array $array, $keepItems, $getValueFunc=null)
Definition: ArrayUtility.php:718
‪TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger
‪static bool canBeInterpretedAsInteger($var)
Definition: MathUtility.php:74
‪TYPO3\CMS\Core\Utility\Exception\MissingArrayPathException
Definition: MissingArrayPathException.php:28
‪TYPO3\CMS\Core\Utility\ArrayUtility\isValidPath
‪static bool isValidPath(array $array, $path, $delimiter='/')
Definition: ArrayUtility.php:144
‪TYPO3\CMS\Core\Utility
Definition: ArrayUtility.php:16
‪TYPO3\CMS\Core\Utility\ArrayUtility\filterRecursive
‪static array filterRecursive(array $array, callable $callback=null)
Definition: ArrayUtility.php:918
‪TYPO3\CMS\Core\Utility\ArrayUtility\sortByKeyRecursive
‪static array sortByKeyRecursive(array $array)
Definition: ArrayUtility.php:354
‪TYPO3\CMS\Core\Utility\ArrayUtility\arrayExport
‪static string arrayExport(array $array=[], $level=0)
Definition: ArrayUtility.php:402
‪TYPO3\CMS\Core\Utility\ArrayUtility\mergeRecursiveWithOverrule
‪static mergeRecursiveWithOverrule(array &$original, array $overrule, $addKeys=true, $includeEmptyValues=true, $enableUnsetFeature=true)
Definition: ArrayUtility.php:654
‪TYPO3\CMS\Core\Utility\ArrayUtility\arrayDiffAssocRecursive
‪static array arrayDiffAssocRecursive(array $array1, array $array2, bool $useArrayDiffAssocBehavior=false)
Definition: ArrayUtility.php:795
‪TYPO3\CMS\Core\Utility\ArrayUtility\getValueByPath
‪static mixed getValueByPath(array $array, $path, $delimiter='/')
Definition: ArrayUtility.php:180
‪TYPO3\CMS\Core\Utility\ArrayUtility\flattenPlain
‪static array flattenPlain(array $array)
Definition: ArrayUtility.php:515
‪TYPO3\CMS\Core\Utility\ArrayUtility\filterByValueRecursive
‪static array filterByValueRecursive($needle='', array $haystack=[])
Definition: ArrayUtility.php:104
‪TYPO3\CMS\Core\Utility\ArrayUtility\arrayDiffKeyRecursive
‪static array arrayDiffKeyRecursive(array $array1, array $array2)
Definition: ArrayUtility.php:768
‪TYPO3\CMS\Core\Utility\ArrayUtility\removeArrayEntryByValue
‪static array removeArrayEntryByValue(array $array, $cmpValue)
Definition: ArrayUtility.php:683
‪TYPO3\CMS\Core\Utility\ArrayUtility\intersectRecursive
‪static array intersectRecursive(array $source, array $mask=[])
Definition: ArrayUtility.php:569
‪TYPO3\CMS\Core\Utility\ArrayUtility\replaceAndAppendScalarValuesRecursive
‪static array replaceAndAppendScalarValuesRecursive(array $array1, array $array2)
Definition: ArrayUtility.php:959
‪TYPO3\CMS\Core\Utility\ArrayUtility\removeByPath
‪static array removeByPath(array $array, $path, $delimiter='/')
Definition: ArrayUtility.php:316
‪TYPO3\CMS\Core\Utility\ArrayUtility\stripTagsFromValuesRecursive
‪static array stripTagsFromValuesRecursive(array $array)
Definition: ArrayUtility.php:897
‪TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode
‪static string[] trimExplode($delim, $string, $removeEmptyValues=false, $limit=0)
Definition: GeneralUtility.php:1059
‪TYPO3\CMS\Core\Utility\ArrayUtility\setValueByPath
‪static array setValueByPath(array $array, $path, $value, $delimiter='/')
Definition: ArrayUtility.php:272
‪TYPO3\CMS\Core\Utility\ArrayUtility
Definition: ArrayUtility.php:24
‪TYPO3\CMS\Core\Utility\ArrayUtility\assertAllArrayKeysAreValid
‪static assertAllArrayKeysAreValid(array $arrayToTest, array $allowedArrayKeys)
Definition: ArrayUtility.php:33
‪TYPO3\CMS\Core\Utility\ArrayUtility\removeNullValuesRecursive
‪static array removeNullValuesRecursive(array $array)
Definition: ArrayUtility.php:233
‪TYPO3\CMS\Core\Utility\ArrayUtility\reIndexNumericArrayKeysRecursive
‪static array reIndexNumericArrayKeysRecursive(array $array)
Definition: ArrayUtility.php:214
‪TYPO3\CMS\Core\Utility\ArrayUtility\sortArrayWithIntegerKeysRecursive
‪static array sortArrayWithIntegerKeysRecursive(array $array)
Definition: ArrayUtility.php:880
‪TYPO3\CMS\Core\Utility\ArrayUtility\sortArraysByKey
‪static array sortArraysByKey(array $arrays, $key, $ascending=true)
Definition: ArrayUtility.php:374
‪TYPO3\CMS\Core\Utility\ArrayUtility\renumberKeysToAvoidLeapsIfKeysAreAllNumeric
‪static array renumberKeysToAvoidLeapsIfKeysAreAllNumeric(array $array=[], $level=0)
Definition: ArrayUtility.php:613
‪TYPO3\CMS\Core\Utility\ArrayUtility\naturalKeySortRecursive
‪static bool naturalKeySortRecursive(array &$array)
Definition: ArrayUtility.php:823
‪TYPO3\CMS\Core\Utility\ArrayUtility\remapArrayKeys
‪static remapArrayKeys(array &$array, array $mappingTable)
Definition: ArrayUtility.php:750
‪TYPO3\CMS\Core\Utility\ArrayUtility\sortArrayWithIntegerKeys
‪static array sortArrayWithIntegerKeys(array $array)
Definition: ArrayUtility.php:865
‪TYPO3\CMS\Core\Utility\ArrayUtility\filterAndSortByNumericKeys
‪static array filterAndSortByNumericKeys($setupArr, $acceptAnyKeys=false)
Definition: ArrayUtility.php:844
‪TYPO3\CMS\Core\Utility\ArrayUtility\convertBooleanStringsToBooleanRecursive
‪static array convertBooleanStringsToBooleanRecursive(array $array)
Definition: ArrayUtility.php:54