Here's one way of doing it:
for($i = 0; $i < 25 && $row = array_shift($data); $i++) {
// do stuff with $row here
}
if(!empty($data)) {
// loop didn't get all of $data, output "more" info here
}
Note that it's rather destructive in that the data processed in the for() loop is removed from the array.
Then again, why are you retrieving more rows from the database than what you actually want? That seems rather wasteful; why not do a "SELECT SQL_CALC_FOUND_ROWS ... LIMIT 25" and then "SELECT FOUND_ROWS()" to determine if more than 25 rows were found in the DB (even though only 25 were returned)?