title: How to manage content when show on frontend in php?
body: <p>I am inserting post in DB from backend using ckEditor. I am inserting post with some html tags and it stored in DB like:</p>
  
  <pre><code>&lt;h1 style="font-size: 20px; color: blue; margin: 0 auto;"&gt;Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text&lt;/h1&gt;
  &lt;h1 style="font-size: 20px; color: blue; margin: 0 auto;"&gt;Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text&lt;/h1&gt;
  </code></pre>
  
  <p>When i fetch content from DB I need to show some content on front end so I used below code in my php code to print some content:</p>
  
  <pre><code>limit_words($post['content'], 100);
  function limit_words($string, $word_limit){
      $words = explode(" ",$string);
      return implode(" ",array_splice($words,0,$word_limit));
  }
  </code></pre>
  
  <p>This returns me something like:</p>
  
  <pre><code>&lt;h1 style="font-size: 20px; color: blue; margin: 0 auto;"&gt;Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text&lt;/h1&gt;
      &lt;h1 style="font-size: 20px;
  </code></pre>
  
  <p>And my html breaks. Can anyone help me to resolve this issue.</p>
  
  <p>Thanks in advance for your attention.</p>