i have a basic foreach loop. its all thats been given to me by the developer as all the other parent code is in another locked away script. here the loop...
the loop is returning results from a database for example the array contains the following...
and will continue looping through
the array of results are sorted by most recent articles first, but what i need to do is limit the loop to return the first 7 results.
how would i incorporate this into the existing foreach loop?
Code:
foreach ($item as $items) {
}
the loop is returning results from a database for example the array contains the following...
$headline
$date
$copy
$image
and will continue looping through
the array of results are sorted by most recent articles first, but what i need to do is limit the loop to return the first 7 results.
how would i incorporate this into the existing foreach loop?