I’ve got a script to get emails, but I only want to output the first (most recent) 5 lines. Each email is displayed as
<div class="toggler unread"><span class="subject">Email Subject</span> </div>
so it’s not simply ending in or whatever, but it still does the same thing. I’m guessing the easiest way would be to only allow 5 s then cut the output, but how could I do this?
It’s PHP, using this script, http://davidwalsh.name/gmail-php-imap
Update:
Solution1:
In this piece of code: http://davidwalsh.name/gmail-php-imap ,add the second line of code:
Solution2:
In the foreach loop section, edit it like this:
Original Solution
Another way: