title: How to sanitize a string without losing HTML and removing JS /SQL
body: <p>I am using Rich Text Editor for accepting input data which has HTML content from client side.</p>
  
  <p>On the server side, I am using PHP based server and sanitize the incoming data. </p>
  
  <p>Is there a builtin PHP functionality, which retains the HTML code and removes the presence of Javascript for XSS + SQL injection codes.</p>