SyntaxFix
Write A Post
Hire A Developer
Questions
array_slice returns a slice of an array
array_slice
$sliced_array = array_slice($array, 0, 5)
is the code you want in your case to return the first five elements