Posted By

maceblue on 07/30/12


Tagged

htmlentities


Versions (?)

htmlEntities


 / Published in: JavaScript
 

like PHP function htmlEntities

  1. function htmlEntities(str) {
  2. return String(str).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
  3. }

Report this snippet  

You need to login to post a comment.