Namespaces

  • Nette
    • Application
    • Caching
    • Collections
    • Config
    • Forms
    • IO
    • Loaders
    • Mail
    • Reflection
    • Security
    • Templates
    • Web
  • None
  • PHP

Classes

  • ArrayTools
  • Callback
  • Component
  • ComponentContainer
  • Configurator
  • DateTime
  • Debug
  • Environment
  • Framework
  • FreezableObject
  • GenericRecursiveIterator
  • Image
  • ImageMagick
  • InstanceFilterIterator
  • Object
  • ObjectMixin
  • Paginator
  • RecursiveComponentIterator
  • ServiceLocator
  • SmartCachingIterator
  • String
  • Tools

Interfaces

  • IComponent
  • IComponentContainer
  • IDebuggable
  • IServiceLocator
  • ITranslator

Exceptions

  • AmbiguousServiceException
  • Overview
  • Namespace
  • Class
  • Tree
  • Other releases

Class ArrayTools

Array tools library.

Final
Namespace: Nette
Author: David Grudl
Located at Utils/ArrayTools.php
Methods summary
final public
# __construct( )

Static class - cannot be instantiated.

Static class - cannot be instantiated.

public static mixed
# get( array $arr, mixed $key, mixed $default = NULL )

Returns array item or $default if item is not set. Example: $val = ArrayTools::get($arr, 'i', 123);

Returns array item or $default if item is not set. Example: $val = ArrayTools::get($arr, 'i', 123);

Parameters

$arr
mixed
array
$key
mixed
key
$default
mixed
default value

Returns

mixed
public static mixed &
# getRef( mixed & $arr, mixed $key )

Returns reference to array item or $default if item is not set.

Returns reference to array item or $default if item is not set.

Parameters

$arr
mixed
array
$key
mixed
key

Returns

mixed
public static array
# mergeTree( array $arr1, array $arr2 )

Recursively appends elements of remaining keys from the second array to the first.

Recursively appends elements of remaining keys from the second array to the first.

Parameters

$arr1
array
$arr2
array

Returns

array
public static integer
# searchKey( array $arr, mixed $key )

Searches the array for a given key and returns the offset if successful.

Searches the array for a given key and returns the offset if successful.

Parameters

$arr
array
input array
$key
mixed
key

Returns

integer
offset if it is found, FALSE otherwise
public static
# insertBefore( array & $arr, mixed $key, array $inserted )

Inserts new array before item specified by key.

Inserts new array before item specified by key.

Parameters

$arr
array
input array
$key
mixed
key
$inserted
array
inserted array
public static
# insertAfter( array & $arr, mixed $key, array $inserted )

Inserts new array after item specified by key.

Inserts new array after item specified by key.

Parameters

$arr
array
input array
$key
mixed
key
$inserted
array
inserted array
public static
# renameKey( array & $arr, mixed $oldKey, mixed $newKey )

Renames key in array.

Renames key in array.

Parameters

$arr
array
$oldKey
mixed
old key
$newKey
mixed
new key
Nette Framework 0.9.7 API documentation generated by ApiGen 2.3.0