Ubiquity  2.5.2
php rapid development framework
UArray Class Reference

Array utilities. More...

+ Inheritance diagram for UArray:

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 getRecursive ($array, $key, $default=null)
 
static getDefaultValue ($array, $key, $default)
 
static save ($array, $filename)
 Save a php array to the disk. More...
 
static remove ($array, $search)
 
static removeByKey ($array, $key)
 Removes from array by key. More...
 
static removeRecursive (&$array, $key)
 
static removeByKeys ($array, $keys)
 
static removeOne ($array, $search)
 
static update (&$array, $search, $newValue)
 
static doubleBackSlashes (&$array)
 
static iSearch ($needle, $haystack, $strict=false)
 
static iRemove ($array, $search)
 
static iRemoveOne ($array, $search)
 
static implodeAsso ($array, $glue, $op='=', $quoteKey='"', $quoteValue = '"')
 
static toJSON ($array)
 
- Static Public Member Functions inherited from UArrayAsTrait
static asPhpArray ($array, $prefix='', $depth=1, $format=false)
 
static asPhpArray_ ($array, $depth=1, $format=false)
 
static asPhpAttribute ($array, $prefix='', $depth=1, $format=false)
 
static asPhpClass ($array, $name, $namespace='', $format=false)
 
static asJSON ($array)
 

Detailed Description

Array utilities.

Ubiquity$UArray This class is part of Ubiquity

Author
jcheron myadd.nosp@m.ress.nosp@m.mail@.nosp@m.gmai.nosp@m.l.com
Version
1.0.6

Definition at line 16 of file UArray.php.

Member Function Documentation

◆ doubleBackSlashes()

static doubleBackSlashes ( $array)
static
Parameters
array$array
Returns
boolean

Definition at line 159 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 35 of file UArray.php.

◆ getDefaultValue()

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

Definition at line 81 of file UArray.php.

◆ getRecursive()

static getRecursive (   $array,
  $key,
  $default = null 
)
static
Parameters
array$array
string | int$key
mixed$default
Returns
mixed

Definition at line 68 of file UArray.php.

◆ getValue()

static getValue (   $array,
  $key,
  $pos 
)
static
Parameters
array$array
string$key
int$pos
Returns
mixed|null

Definition at line 52 of file UArray.php.

◆ implodeAsso()

static implodeAsso (   $array,
  $glue,
  $op = '=',
  $quoteKey = '"',
  $quoteValue = '"' 
)
static

Definition at line 187 of file UArray.php.

◆ iRemove()

static iRemove (   $array,
  $search 
)
static

Definition at line 169 of file UArray.php.

◆ iRemoveOne()

static iRemoveOne (   $array,
  $search 
)
static

Definition at line 180 of file UArray.php.

◆ isAssociative()

static isAssociative (   $array)
static

Tests if array is associative.

Parameters
array$array
Returns
boolean

Definition at line 24 of file UArray.php.

◆ iSearch()

static iSearch (   $needle,
  $haystack,
  $strict = false 
)
static

Definition at line 165 of file UArray.php.

◆ remove()

static remove (   $array,
  $search 
)
static

Definition at line 97 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 115 of file UArray.php.

◆ removeByKeys()

static removeByKeys (   $array,
  $keys 
)
static

Definition at line 132 of file UArray.php.

◆ removeOne()

static removeOne (   $array,
  $search 
)
static

Definition at line 140 of file UArray.php.

◆ removeRecursive()

static removeRecursive ( $array,
  $key 
)
static

Definition at line 122 of file UArray.php.

◆ save()

static save (   $array,
  $filename 
)
static

Save a php array to the disk.

Parameters
array$arrayThe array to save
string$filenameThe path of the file to save in
Returns
int

Definition at line 92 of file UArray.php.

◆ toJSON()

static toJSON (   $array)
static

Definition at line 199 of file UArray.php.

◆ update()

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

Definition at line 147 of file UArray.php.


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