Method: a::get

Gets an element of an array by key

Info

Syntax

a::get($array, $key, $default=null)

Parameters

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'