Documentation

AbstractArray
in package
implements ArrayableInterface, ArrayAccess, Countable, IteratorAggregate

AbstractYes

Pop utils abstract array object class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
2.1.0

Table of Contents

Interfaces

ArrayableInterface
Pop utils arrayable interface
ArrayAccess
Countable
IteratorAggregate

Properties

$data  : mixed
Array data

Methods

__get()  : mixed
Get a value
__isset()  : bool
Is value set
__set()  : static
Magic method to set the property to the value of $this->data[$name]
__unset()  : void
Unset a value
contains()  : bool
Determine if an item exists in the array
count()  : int
Method to get the count of data in the collection
current()  : mixed
Get the current item of the array
first()  : mixed
Get the first item of the array
getIterator()  : ArrayIterator
Method to iterate over the array object
join()  : string
Join the array values into a string
key()  : mixed
Get the key of the current item of the array
ksort()  : array<string|int, mixed>
Sort array by keys
ksortDesc()  : static
Sort array by keys, descending
last()  : mixed
Get the last item of the array
next()  : mixed
Get the next item of the array
offsetExists()  : bool
ArrayAccess offsetExists
offsetGet()  : mixed
ArrayAccess offsetGet
offsetSet()  : void
ArrayAccess offsetSet
offsetUnset()  : void
ArrayAccess offsetUnset
sort()  : array<string|int, mixed>
Sort array
sortDesc()  : static
Sort array descending
split()  : static
Split a string into an array object
toArray()  : array<string|int, mixed>
Get the values as an array
uksort()  : array<string|int, mixed>
Sort array by user-defined callback using keys
usort()  : static
Sort array by user-defined callback

Properties

Methods

__get()

Get a value

public __get(string $name) : mixed
Parameters
$name : string

__isset()

Is value set

public __isset(string $name) : bool
Parameters
$name : string
Return values
bool

__set()

Magic method to set the property to the value of $this->data[$name]

public __set([string|null $name = null ][, mixed $value = null ]) : static
Parameters
$name : string|null = null
$value : mixed = null
Return values
static

__unset()

Unset a value

public __unset(string $name) : void
Parameters
$name : string

contains()

Determine if an item exists in the array

public contains(mixed $key[, bool $strict = false ]) : bool
Parameters
$key : mixed
$strict : bool = false
Return values
bool

count()

Method to get the count of data in the collection

public count() : int
Return values
int

current()

Get the current item of the array

public current() : mixed

first()

Get the first item of the array

public first() : mixed

getIterator()

Method to iterate over the array object

public getIterator() : ArrayIterator
Return values
ArrayIterator

join()

Join the array values into a string

public join(string $glue[, string $finalGlue = '' ]) : string
Parameters
$glue : string
$finalGlue : string = ''
Return values
string

key()

Get the key of the current item of the array

public key() : mixed

ksort()

Sort array by keys

public ksort([int $flags = SORT_REGULAR ][, bool $descending = false ]) : array<string|int, mixed>
Parameters
$flags : int = SORT_REGULAR
$descending : bool = false
Return values
array<string|int, mixed>

ksortDesc()

Sort array by keys, descending

public ksortDesc([int $flags = SORT_REGULAR ]) : static
Parameters
$flags : int = SORT_REGULAR
Return values
static

offsetExists()

ArrayAccess offsetExists

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Return values
bool

offsetGet()

ArrayAccess offsetGet

public offsetGet(mixed $offset) : mixed
Parameters
$offset : mixed

offsetSet()

ArrayAccess offsetSet

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed

offsetUnset()

ArrayAccess offsetUnset

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed

sort()

Sort array

public sort([int $flags = SORT_REGULAR ][, bool $assoc = true ][, bool $descending = false ]) : array<string|int, mixed>
Parameters
$flags : int = SORT_REGULAR
$assoc : bool = true
$descending : bool = false
Return values
array<string|int, mixed>

sortDesc()

Sort array descending

public sortDesc([int $flags = SORT_REGULAR ][, bool $assoc = true ]) : static
Parameters
$flags : int = SORT_REGULAR
$assoc : bool = true
Return values
static

split()

Split a string into an array object

public static split(string $string, string $separator[, int $limit = PHP_INT_MAX ]) : static
Parameters
$string : string
$separator : string
$limit : int = PHP_INT_MAX
Return values
static

toArray()

Get the values as an array

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

uksort()

Sort array by user-defined callback using keys

public uksort(mixed $callback) : array<string|int, mixed>
Parameters
$callback : mixed
Return values
array<string|int, mixed>

usort()

Sort array by user-defined callback

public usort(mixed $callback[, bool $assoc = true ]) : static
Parameters
$callback : mixed
$assoc : bool = true
Return values
static

        
On this page

Search results