Ubiquity  2.0.3
php rapid development framework
UArray Class Reference

Array utilities. More...

Static Public Member Functions

static isAssociative ($array)
 Tests if array is associative. More...
 
static extractKeys ($array, $keys)
 Returns a new array with the keys $keys. More...
 
static getValue ($array, $key, $pos)
 
static getDefaultValue ($array, $key, $default)
 
static asPhpArray ($array, $prefix="", $depth=1, $format=false)
 
static asJSON ($array)
 
static remove ($array, $search)
 
static removeByKey ($array, $key)
 Removes from array by key. More...
 
static removeOne ($array, $search)
 
static update (&$array, $search, $newValue)
 
static doubleBackSlashes (&$array)
 

Static Private Member Functions

static parseValue ($v, $prefix="", $depth=1, $format=false)
 

Detailed Description

Array utilities.

Author
jc

Definition at line 10 of file UArray.php.

Member Function Documentation

◆ asJSON()

static asJSON (   $array)
static

Definition at line 78 of file UArray.php.

◆ asPhpArray()

static asPhpArray (   $array,
  $prefix = "",
  $depth = 1,
  $format = false 
)
static

Definition at line 53 of file UArray.php.

◆ doubleBackSlashes()

static doubleBackSlashes ( $array)
static

Definition at line 120 of file UArray.php.

◆ extractKeys()

static extractKeys (   $array,
  $keys 
)
static

Returns a new array with the keys $keys.

Parameters
array$arrayan associative array
array$keyssome keys
Returns
array

Definition at line 27 of file UArray.php.

◆ getDefaultValue()

static getDefaultValue (   $array,
  $key,
  $default 
)
static

Definition at line 46 of file UArray.php.

◆ getValue()

static getValue (   $array,
  $key,
  $pos 
)
static

Definition at line 37 of file UArray.php.

◆ isAssociative()

static isAssociative (   $array)
static

Tests if array is associative.

Parameters
array$array
Returns
boolean

Definition at line 17 of file UArray.php.

◆ parseValue()

static parseValue (   $v,
  $prefix = "",
  $depth = 1,
  $format = false 
)
staticprivate

Definition at line 124 of file UArray.php.

◆ remove()

static remove (   $array,
  $search 
)
static

Definition at line 82 of file UArray.php.

◆ removeByKey()

static removeByKey (   $array,
  $key 
)
static

Removes from array by key.

Parameters
array$array
int | string$key
Returns
array

Definition at line 99 of file UArray.php.

◆ removeOne()

static removeOne (   $array,
  $search 
)
static

Definition at line 106 of file UArray.php.

◆ update()

static update ( $array,
  $search,
  $newValue 
)
static

Definition at line 113 of file UArray.php.


The documentation for this class was generated from the following file: