title: How to set ENT_QUOTES flag by default for htmlentities() function in php
body: <p>I am using <code>htmlentities($data, ENT_QUOTES)</code> on any data fetched from database before displaying it.</p>
  
  <p>Is there a way I can set the flag <code>ENT_QUOTES</code> by default for <code>htmlentities()</code> function, so that even if I write <code>htmlentities($data)</code> it should work as <code>htmlentities($data, ENT_QUOTES)</code>.</p>
  
  <p>As written in the documentation of php the default is <code>ENT_COMPAT | ENT_HTML401</code>.</p>
  
  <p>For your information I am using codeigniter framework, php5.</p>
  
  <p>UPDATE 1: wrapping with a custom function as suggested by Michael could help but I have already used this everywhere in the website without ENT_QUOTES flag and was wondering if there is a way provided by php to change defaults for its functions.</p>
  
  <p>UPDATE 2: I think html_escape() inbuilt function provided by codeigniter (suggested by Wesley) is the best for me so that i don't have to write my own wrapper function.</p>