Posted By

Zwendel on 12/28/09


Tagged

form php quote input field characters


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

jlan


Handling quote characters in HTML form input fields


 / Published in: PHP
 

  1. htmlentities($this->value, ENT_QUOTES)
  2.  
  3. // The ENT_QUOTES parameter in the htmlentities() function ensures that single quote characters are encoded, since by default they are not (though double quote characters are). htmlentities() also encodes other characters and is useful for ensuring that characters such as "<" and "&" are not interpreted as HTML special characters.
  4. // source: http://www.primitivetype.com/articles/quotes_inputs.php

Report this snippet  

You need to login to post a comment.