Wordpress - First and last result of wp_query

/ Published in: PHP
Save to your folder(s)

I needed to know the first time a user took a quiz and the last quiz they took. I utilized php count() and as I iterated through the array, I incremented a variable ($i) which before the loop, I already set it to 1. If $i was equal to 1, I printed it out. If I was equal to the total count, I printed it out. Everything else got ignored.

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.