I have an array:
array( 4 => \'apple\', 7 => \'orange\', 13 => \'plum\' )
I would like to get the first element of this array. Expect
$myArray = array (4 => 'apple', 7 => 'orange', 13 => 'plum'); $arrayKeys = array_keys($myArray); // The first element of your array is: echo $myArray[$arrayKeys[0]];