Add a value to a stack
static
array
add
(string $stack_name, mixed $value, [string $value_name = null])
-
string
$stack_name: The name of the stack
-
mixed
$value: The value to add
-
string
$value_name: The name of the value to add
Creates and retreives a named stack instance
static
array
create_stack
(string $stack_name)
-
string
$stack_name: The name of the stack to create and return
Returns all of the values of the stack
static
void
get
(string $stack_name, [mixed $format = null])
-
string
$stack_name: The name of the stack to output
-
mixed
$format: A printf-style formatting string or callback used to output each stack element
Get a single item from a given stack.
static
mixed
get_item
(string $stack_name, $value_name, [mixed $default_value = null], string $value)
-
string
$stack_name: The name of the stack to fetch an item from.
-
string
$value: The item to fetch.
-
mixed
$default_value: The default value to return if the item does not exist in the stack.
-
$value_name
Retreive a named stack instance
static
Stack
get_named_stack
(
string $stack_name)
-
string
$stack_name: The name of the stack to return
Check for the existence of a given stack item.
static
boolean
has
(string $stack_name, $value_name, string $value)
-
string
$stack_name: The name of the stack in which to check.
-
string
$value: The value to check for.
-
$value_name
Outputs all of the values of the stack
static
void
out
(string $stack_name, [mixed $format = null])
-
string
$stack_name: The name of the stack to output
-
mixed
$format: A printf-style formatting string or callback used to output each stack element
Remove a value to a stack
static
array
remove
(string $stack_name, string $value_name)
-
string
$stack_name: The name of the stack
-
string
$value_name: The name of the value to remove