Namespaces

  • Latte
    • Loaders
    • Macros
    • Runtime
  • Nette
    • Application
      • Responses
      • Routers
      • UI
    • Bridges
      • ApplicationLatte
      • ApplicationTracy
      • CacheLatte
      • DatabaseDI
      • DatabaseTracy
      • DITracy
      • FormsLatte
      • Framework
      • HttpTracy
      • SecurityTracy
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Drivers
      • Reflection
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Latte
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
    • Reflection
    • Security
    • Templating
    • Utils
  • NetteModule
  • none
  • Tracy

Classes

  • ArrayHash
  • ArrayList
  • Arrays
  • Callback
  • DateTime
  • FileSystem
  • Finder
  • Html
  • Image
  • Json
  • LimitedScope
  • MimeTypeDetector
  • ObjectMixin
  • Paginator
  • Random
  • Strings
  • TokenIterator
  • Tokenizer
  • Validators

Interfaces

  • IHtmlString

Exceptions

  • AssertionException
  • JsonException
  • RegexpException
  • TokenizerException
  • UnknownImageFileException
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Other releases
  • Nette homepage

Class Arrays

Array tools library.

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

Static class - cannot be instantiated.

Static class - cannot be instantiated.

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

Returns item from array or $default if item is not set.

Returns item from array or $default if item is not set.

Parameters

$arr
array
$key
string|integer|array
one or more keys
$default
mixed

Returns

mixed

Throws

Nette\InvalidArgumentException
if item does not exist and default value is not provided
public static mixed &
# getRef( array & $arr, string|integer|array $key )

Returns reference to array item.

Returns reference to array item.

Parameters

$arr
array
$key
string|integer|array
one or more keys

Returns

mixed

Throws

Nette\InvalidArgumentException
if traversed item is not an array
public static array
# mergeTree( $arr1, $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.

Returns

array
public static integer|false
# searchKey( $arr, $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.

Returns

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

Inserts new array before item specified by key.

Inserts new array before item specified by key.

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

Inserts new array after item specified by key.

Inserts new array after item specified by key.

public static
# renameKey( array & $arr, $oldKey, $newKey )

Renames key in array.

Renames key in array.

public static array
# grep( array $arr, $pattern, $flags = 0 )

Returns array entries that match the pattern.

Returns array entries that match the pattern.

Returns

array
public static array
# flatten( array $arr, $preserveKeys = FALSE )

Returns flattened array.

Returns flattened array.

Returns

array
public static boolean
# isList( $value )

Finds whether a variable is a zero-based integer indexed array.

Finds whether a variable is a zero-based integer indexed array.

Returns

boolean
public static array|stdClass
# associate( array $arr, $path )

Reformats table to associative tree. Path looks like 'field|field[]field->field=field'.

Reformats table to associative tree. Path looks like 'field|field[]field->field=field'.

Returns

array|stdClass
Nette 2.2 API documentation generated by ApiGen 2.8.0