<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Comments on snippet: 'Shorten text without braking words'</title>
    <description>Snipplr comments feed</description>
    <link>https://snipplr.com/</link>
    <lastBuildDate>Wed, 08 Apr 2026 02:21:25 +0000</lastBuildDate>
    <item>
      <title>itsmeameer said on 13/Dec/2012</title>
      <link>https://snipplr.com/view/5260/shorten-text-without-braking-words</link>
      <description>&lt;p&gt;this function is not fully accurate!&#13;
&#13;
function shorten($value="", $limit=20, $end="..."){&#13;
	if( strlen($value) &gt; $limit ){&#13;
		list($new_value, $end) = explode( "\n", wordwrap($value, $limit, "\n", false) );&#13;
		return ( $end ) ? $new_value.'...' : $new_value;&#13;
	}else{&#13;
		return $value;&#13;
	}&#13;
}&lt;/p&gt;</description>
      <pubDate>Thu, 13 Dec 2012 21:39:29 UTC</pubDate>
      <guid>https://snipplr.com/view/5260/shorten-text-without-braking-words</guid>
    </item>
  </channel>
</rss>
