View Full Version : get first 5 elements of an array

08-06-2007, 05:41 AM
I have a array called


how can i set $ids[] = to only the first 5 elements of the array. (the array is really pulled from a post)

08-06-2007, 11:14 AM
You can use the array_slice() function, like so:

$ids = array_slice($ids, 0, 5);

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum