Created
June 9, 2016 15:43
-
-
Save clemgrim/1aa94b60330a9e40f18795784f3d3ec6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$str = htmlentities($str, ENT_NOQUOTES, 'utf-8'); | |
$str = preg_replace('#&([A-za-z])(?:acute|cedil|caron|circ|grave|orn|ring|slash|th|tilde|uml);#', '\1', $str); | |
$str = preg_replace('#&([A-za-z]{2})(?:lig);#', '\1', $str); | |
$str = preg_replace('#&[^;]+;#', '', $str); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment