PageArray/WireArray


Getting Items

$a->slice($n)

Introduced in Version 2.0

Description

Returns a new WireArray containing a slice of items from the $n'th item to the end.

This example would return all skyscrapers except for the first one. Like PHP arrays, WireArrays start from an index of 0, so specifying 1 actually means: start from the second item. Here we are essentially saying: give me a slice of all skyscrapers, starting with the second item. 

$items = $skyscrapers->slice(1); 


Post Comment