Strip HTML Entities
Posted:
Thursday, March 29th, 2012Last modified:
Tuesday, May 5th, 2015Topics:
PHPThis is a PHP function to strip HTML entities from a string.
<?php /** * Strips HTML entities from a string. * * @param STRING $str The string to clean. */ function removeHtmlEntities($str) { $regex = '@&\w+;@i'; return preg_replace($regex, '', $str); } ?>
Available Wiki Topics
The operator of this site makes no claims, promises, or guarantees of the accuracy, completeness, originality, uniqueness, or even general adequacy of the contents herein and expressly disclaims liability for errors and omissions in the contents of this website.