コード例 #1
0
function xml_utf8_encode($str)
{
    return numeric_entify_utf8(htmlspecialchars($str));
}
コード例 #2
0
 /**
  * xml_encode()
  * helper
  */
 function xml_encode($utf8_string)
 {
     static $find = array('&', '<', '>');
     static $replace = array('&#x26;', '&#x3C;', '&#x3E;');
     return numeric_entify_utf8(str_replace($find, $replace, $utf8_string));
 }