Supposed we have a lengthy report to export, at each page's bottom we print
Page: $current_page / $total_pages
Problem is $total_pages is not easy to pre-count as more pages can be generated dynamically during file export.
What is your approach? Thank you!
Obviously, you can't output something before you know it.
What you can do is store your output until you're done (using ob_start()), and then go through and clean up afterward.