Array


This library provides methods that can help you manage arrays.


Properties

No public properties available.


sort()

Sort array values after striping words like “The” and removing accented characters.

$this->zajlib->array->sort($array)

@param array $array The array to be sorted.
@return array The sorted array.

merge()

Merges two array without a notice. This is similar to PHP’s built-in array_merge but will not fail if one or the other parameters is not an array.

$this->zajlib->array->merge($array1, $array2)

@param array $array1 The first array.
@param array $array2 The second array.
@return array Returns the merged array. If one or the other is not an array, only the array is returned. If neither are arrays an empty array is returned.

to_code()

This generates executable php code from a given array. The returned code will use PHP’s array() function.

$this->zajlib->array->to_code($array)

@param array $array The array values to use when generating the code.
@return string The php code required to generate this array.

to_object()

Recursively typecasts an array to an object.

Unlike using (object) array() which will only typecast the top level of a multi-dimensional array, this method is recursive.

@param array $array The array values to use when generating the code.
@return Object The array as an object.

Outlast Web & Mobile Development (c) 2023 | Privacy Policy |