I have an array:
array( 4 => \'apple\', 7 => \'orange\', 13 => \'plum\' )
I would like to get the first element of this array. Expect
A kludgy way is:
$foo = array( 4 => 'apple', 7 => 'orange', 13 => 'plum' ); function get_first ($foo) { foreach ($foo as $k=>$v){ return $v; } } print get_first($foo);