c_ws_plugin__s2member_utils_arrays
public class c_ws_plugin__s2member_utils_arrays
3.5
( 8 Methods ) Method Summary | |
---|---|
public static array | array_unique(array $array) Extends |
public static array | force_integers(array $array) Forces integer values on each array value (also supports multi-dimensional arrays). |
public static array | force_strings(array $array) Forces string values on each array value (also supports multi-dimensional arrays). |
public static bool | in_regex_array(str $string, array $array) Searches an array (or even a multi-dimensional array) of regular expressions, to match against a string value. |
public Unlike | ksort_deep(array $array, int $flags) Sorts arrays (also supports multi-dimensional arrays) by key, low to high. |
public static bool | regex_in_array(str $regex, bool $array) Searches an array (or even a multi-dimensional array) using a regular expression match against array values. |
public static array | remove_0b_strings(array $array) Removes all 0-byte strings from an array (or even a multi-dimensional array). |
public static array | remove_nulls(array $array) Removes all null values from an array (or even a multi-dimensional array). |
public static array array_unique(array $array)
Extends array_unique()
to support multi-dimensional arrays.
3.5
array $array - Expects an incoming array.
array - Returns the $array
after having reduced it to a unique set of values.
public static array force_integers(array $array)
Forces integer values on each array value (also supports multi-dimensional arrays).
111101
array $array - An input array.
array - Returns the $array
after having forced it to set of integer values.
public static array force_strings(array $array)
Forces string values on each array value (also supports multi-dimensional arrays).
111101
array $array - An input array.
array - Returns the $array
after having forced it to set of string values.
public static bool in_regex_array(str $string, array $array)
Searches an array (or even a multi-dimensional array) of regular expressions, to match against a string value.
3.5
str $string - A string to test against.
array $array - An array of regex patterns to match against $string
.
bool - True if at least one regular expression in the $array
matched $string
, else false.
public Unlike ksort_deep(array $array, int $flags)
Sorts arrays (also supports multi-dimensional arrays) by key, low to high.
111205
array $array - An input array.
int $flags - Optional. Can be used to modify the sorting behavior. See: http://www.php.net/manual/en/function.ksort.php
Unlike - PHP's ksort()
, this function returns the array, and does NOT work on a reference.
public static bool regex_in_array(str $regex, bool $array)
Searches an array (or even a multi-dimensional array) using a regular expression match against array values.
3.5
str $regex - A regular expression to look for inside the array.
bool - True if the regular expression matched at least one value in the array, else false.
public static array remove_0b_strings(array $array)
Removes all 0-byte strings from an array (or even a multi-dimensional array).
111216
array $array - An input array.
array - Returns the $array
after having reduced its set of values.
public static array remove_nulls(array $array)
Removes all null values from an array (or even a multi-dimensional array).
111101
array $array - An input array.
array - Returns the $array
after having reduced its set of values.
Array utilities.