Here's how you can get the first N elements of an array, it's so simple with the use of array_slice :
1
2
3
4
5
6
7
8
9
10
<?php// Array$myArray=array("bird","dog","cat","horse","lizard");// Get the 2 first elements$output=array_slice($myArray,0,2);// Result// This will give an array with elements : "bird", "dog"?>