title: Pagination, items per page dependant on number of results (PHP)
body: <p>long time lurker first time asker.</p>
  
  <p>I'm trying to piece together a pagination function that will take into account the total amount of items and increase the results per page to ensure each page is fully populated.</p>
  
  <p>For example if I had 35 results and I wanted a minimum of 10 results per page it would ideally return 12, 12 &amp; 11 results per page.</p>
  
  <p>Clearly my logic-fu is weak because I for the life of me cannot seem to comprehend this seemingly simple task. Embarrassing (it pains me to ask) as I've been at this for a week now and I know there's a simple answer to this.</p>
  
  <p>I'm not necessarily asking for a solution (though that would be appreciated) as a hint in the right direction may be all I need.</p>