PHP : Only display First 5 Lines of Variable
<p>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</p>

<pre><code>&lt;div class="toggler unread"&gt;&lt;span class="subject"&gt;Email Subject&lt;/span&gt; &lt;/div&gt;
</code></pre>

<p>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?</p>

<p>It's PHP, using this script, <a href="http://davidwalsh.name/gmail-php-imap" rel="nofollow">http://davidwalsh.name/gmail-php-imap</a></p>
