Created
October 3, 2013 04:52
-
-
Save slav123/6805169 to your computer and use it in GitHub Desktop.
produce xml safe stuff, same as ENT_XML1 but works with php 5.3
This file contains hidden or 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 | |
function xmlsafe($string) { | |
$replace = array( | |
'"'=> """, | |
"&" => "&", | |
"'"=> "'", | |
"<" => "<", | |
">"=> ">" | |
); | |
return strtr($string, $replace); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment