Packages

  • Nette
    • Application
      • Diagnostics
      • Responses
      • Routers
      • UI
    • Caching
      • Storages
    • ComponentModel
    • Config
      • Adapters
      • Extensions
    • Database
      • Diagnostics
      • Drivers
      • Reflection
      • Table
    • DI
      • Diagnostics
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Latte
      • Macros
    • Loaders
    • Localization
    • Mail
    • Reflection
    • Security
      • Diagnostics
    • Templating
    • Utils
      • PhpGenerator
  • NetteModule
  • None
  • PHP

Classes

  • NArrays
  • NFinder
  • NHtml
  • NJson
  • NLimitedScope
  • NMimeTypeDetector
  • NNeon
  • NNeonEntity
  • NPaginator
  • NStrings
  • NTokenizer
  • NValidators

Exceptions

  • NAssertionException
  • NJsonException
  • NNeonException
  • NRegexpException
  • Overview
  • Package
  • Class
  • Tree

Class NArrays

Array tools library.

Final
Package: 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, mixed $key, mixed $default = NULL )

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

Returns array item or $default if item is not set. Example: $val = NArrays::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
public static array
# grep( array $arr, string $pattern, integer $flags = 0 )

Returns array entries that match the pattern.

Returns array entries that match the pattern.

Parameters

$arr
array
$pattern
string
$flags
integer

Returns

array
public static array
# flatten( array $arr )

Returns flattened array.

Returns flattened array.

Parameters

$arr
array

Returns

array
Nette Framework 2.0.1 (for PHP 5.2, prefixed) API API documentation generated by ApiGen 2.7.0