I want to return first 5 items from array. How can I do this?
See Question&Answers more detail:osarray_slice
returns a slice of an array
$sliced_array = array_slice($array, 0, 5)
is the code you want in your case to return the first five elements