title: Limited content break the HTML layout in php
body: <p>I am facing an issues when I tried to limit the content of <code>description</code> , I have tried like this :</p>
  
  <pre><code>&lt;?php 
  $intDescLt = 400;
  $content   = $arrContentList[$arr-&gt;nid]['description'];
  $excerpt   = substr($content, 0, $intDescLt);
  ?&gt;
  &lt;div class="three16 DetailsDiv"&gt;
      &lt;?php echo $excerpt; ?&gt;
  &lt;div&gt;
  </code></pre>
  
  <p>In the description field if I simply put the content without html tags it works fine but if I put the content with html tags and if limit reach to the end before the closing tag, It applied that tab style to all the content after that. </p>
  
  <p>So I need to know that how can I resolve this issue.</p>
  
  <p><strong>Ex.</strong> 
  <strong><em>Issue :</em></strong> </p>
  
  <pre><code>$string = "&lt;p&gt;&lt;b&gt;Lorem Ipsum&lt;/b&gt; is simply dummy text of the printing and typesetting industry.&lt;/p&gt;";
  echo substr($string, 0, 15);
  </code></pre>
  
  <p><strong><em>Html output in console:</em></strong> <code>&lt;p&gt;&lt;b&gt;Lorem Ipsu</code>
  And now it applied that <code>&lt;b&gt;</code> tag to rest of the content in the page.</p>
  
  <p><strong><em>Expected output in console:</em></strong> <code>&lt;p&gt;&lt;b&gt;Lorem Ipsu&lt;/b&gt;</code></p>