Views: Show "Showing X-X of X results" (page and result counter) in Drupal 7
Submitted by Jeff Geerling on June 13, 2011 - 3:39pm
I needed to display a page/item counter on a view on one of my Drupal 7 sites, using Views 7.x-3.x. This counter would display at the bottom of the view, just above the pager, and needed to display the current number of results being displayed, along with the total number of results.
Views provides all this data right inside the $views object, so all I needed to do was add the following PHP snippet (including the <?php ?> delimiters) to a 'Global: PHP' textarea in my view's footer: