PHP: Escape Character in XML


function simpleFilter($source){
return str_replace(array(“<“, “>”, “\””, “‘”, “&”), array(“&lt;”, “&gt;”, “&quot;”, “&apos;”, “&amp;”), $source);
}

Advertisements