Method: a::get
Gets an element of an array by key
Info
Syntax
a::get($array, $key, $default=null)
Parameters
- $array (array) The source array
- $key (mixed) The key to look for
- $default (mixed) Optional default value, which should be returned if no element has been found
Return (mixed)
Example
$array = array(
'cat' => 'miao',
'dog' => 'wuff',
'bird' => 'tweet'
);
echo a::get($array, 'cat');
// output: 'miao'
echo a::get($array, 'elephant', 'shut up');
// output: 'shut up'