title: Replace instances of excessive periods to a single &hellip; entity
body: <p>I'm trying to filter publicly submitted content with PHP to prevent folks from adding too many periods to the end of their content.</p>
  
  <p>Submitted content might be in the form of this html:</p>
  
  <pre><code>&lt;p&gt;Hi Jummy. I haz the lolz...............&lt;/p&gt;
  &lt;h3&gt;Yeah.... &lt;a href="/foo"&gt;dem lolz are funny&lt;/a&gt;..&lt;/h3&gt;
  </code></pre>
  
  <p>Ideally, I'd like to replace the instances of excessive periods with the following rules</p>
  
  <pre><code>1 period = left alone
  2 periods = 1 period
  2+ periods = &amp;hellip;
  </code></pre>
  
  <p>So the above example would become:</p>
  
  <pre><code>&lt;p&gt;Hi Jummy. I haz the lolz&amp;hellip;&lt;/p&gt;
  &lt;h3&gt;Yeah&amp;hellip; &lt;a href="/foo"&gt;dem lolz are funny&lt;/a&gt;.&lt;/h3&gt;
  </code></pre>
  
  <p>Many thanks</p>