Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

keep only n elements of array php

return array_slice($array, 0, $n); // Keep only n first elements of the array and
// returns them
 
PREVIOUS NEXT
Tagged: #elements #array #php
ADD COMMENT
Topic
Name
7+2 =