[ Index ]

PHP Cross Reference of phpBB-3.2.11-deutsch

title

Body

[close]

/vendor/zendframework/zend-stdlib/src/ -> ArrayUtils.php (summary)

Zend Framework (http://framework.zend.com/)

Copyright: Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
License: http://framework.zend.com/license/new-bsd New BSD License
File Size: 335 lines (10 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 9 functions

  hasStringKeys()
  hasIntegerKeys()
  hasNumericKeys()
  isList()
  isHashTable()
  inArray()
  iteratorToArray()
  merge()
  filter()

Functions
Functions that are not part of a class:

hasStringKeys($value, $allowEmpty = false)   X-Ref
Test whether an array contains one or more string keys

param: mixed $value
param: bool  $allowEmpty    Should an empty array() return true
return: bool

hasIntegerKeys($value, $allowEmpty = false)   X-Ref
Test whether an array contains one or more integer keys

param: mixed $value
param: bool  $allowEmpty    Should an empty array() return true
return: bool

hasNumericKeys($value, $allowEmpty = false)   X-Ref
Test whether an array contains one or more numeric keys.

A numeric key can be one of the following:
- an integer 1,
- a string with a number '20'
- a string with negative number: '-1000'
- a float: 2.2120, -78.150999
- a string with float:  '4000.99999', '-10.10'

param: mixed $value
param: bool  $allowEmpty    Should an empty array() return true
return: bool

isList($value, $allowEmpty = false)   X-Ref
Test whether an array is a list

A list is a collection of values assigned to continuous integer keys
starting at 0 and ending at count() - 1.

For example:
<code>
$list = array('a', 'b', 'c', 'd');
$list = array(
0 => 'foo',
1 => 'bar',
2 => array('foo' => 'baz'),
);
</code>

param: mixed $value
param: bool  $allowEmpty    Is an empty list a valid list?
return: bool

isHashTable($value, $allowEmpty = false)   X-Ref
Test whether an array is a hash table.

An array is a hash table if:

1. Contains one or more non-integer keys, or
2. Integer keys are non-continuous or misaligned (not starting with 0)

For example:
<code>
$hash = array(
'foo' => 15,
'bar' => false,
);
$hash = array(
1995  => 'Birth of PHP',
2009  => 'PHP 5.3.0',
2012  => 'PHP 5.4.0',
);
$hash = array(
'formElement,
'options' => array( 'debug' => true ),
);
</code>

param: mixed $value
param: bool  $allowEmpty    Is an empty array() a valid hash table?
return: bool

inArray($needle, array $haystack, $strict = false)   X-Ref
Checks if a value exists in an array.

Due to "foo" == 0 === TRUE with in_array when strict = false, an option
has been added to prevent this. When $strict = 0/false, the most secure
non-strict check is implemented. if $strict = -1, the default in_array
non-strict behaviour is used.

param: mixed $needle
param: array $haystack
param: int|bool $strict
return: bool

iteratorToArray($iterator, $recursive = true)   X-Ref
Convert an iterator to an array.

Converts an iterator to an array. The $recursive flag, on by default,
hints whether or not you want to do so recursively.

param: array|Traversable  $iterator     The array or Traversable object to convert
param: bool               $recursive    Recursively check all nested structures
return: array

merge(array $a, array $b, $preserveNumericKeys = false)   X-Ref
Merge two arrays together.

If an integer key exists in both arrays and preserveNumericKeys is false, the value
from the second array will be appended to the first array. If both values are arrays, they
are merged together, else the value of the second array overwrites the one of the first array.

param: array $a
param: array $b
param: bool  $preserveNumericKeys
return: array

filter(array $data, $callback, $flag = null)   X-Ref
Compatibility Method for array_filter on <5.6 systems

param: array $data
param: callable $callback
param: null|int $flag
return: array



Generated: Wed Nov 11 20:33:01 2020 Cross-referenced by PHPXref 0.7.1