<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Comments on snippet: 'Very short snippet: PHP word cut'</title>
    <description>Snipplr comments feed</description>
    <link>https://snipplr.com/</link>
    <lastBuildDate>Thu, 16 Apr 2026 07:22:57 +0000</lastBuildDate>
    <item>
      <title>torkil said on 13/Dec/2008</title>
      <link>https://snipplr.com/view/8520/very-short-snippet-php-word-cut</link>
      <description>&lt;p&gt;In my opinion this is a better solution, both because you avoid the loop but it also takes into consideration that the content might be shorter than the limit:&#13;
&#13;
$contentTemp = explode(' ', $content);&#13;
if (count($contentTemp) &gt; $limit) {&#13;
	$content = implode(' ', array_slice($contentTemp, 0, $limit)) . '...';&#13;
}&#13;
return $content;&lt;/p&gt;</description>
      <pubDate>Sat, 13 Dec 2008 16:08:25 UTC</pubDate>
      <guid>https://snipplr.com/view/8520/very-short-snippet-php-word-cut</guid>
    </item>
  </channel>
</rss>
